Skip to content

Commit

Permalink
Fully inspect the module with phpstan, phpcs, phpcbf
Browse files Browse the repository at this point in the history
  • Loading branch information
kylehuynh205 committed Jun 8, 2023
1 parent ce63674 commit c54c8fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions css/facets_year_range.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.facets-widget-year_range ul {
list-style-type: none;
margin: 0;
padding: 0;
list-style-type: none;
margin: 0;
padding: 0;
}
.input-error{
.input-error {
outline: 1px solid red;
}
12 changes: 6 additions & 6 deletions src/Plugin/facets/processor/YearRangeProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@ public function preQuery(FacetInterface $facet): void {
if (preg_match('/\(min:([^,]*),max:(.*)\)/i', $item, $matches)) {
if (!empty($matches[1]) && !empty($matches[2])) {
$item = [
$matches[1],
$matches[2],
0 => $matches[1],
1 => $matches[2],
'min' => $matches[1],
'max' => $matches[2],
];
}
elseif (!empty($matches[1]) && empty($matches[2])) {
$item = [
$matches[1],
date('U', strtotime('+100 years')),
0 => $matches[1],
1 => date('U', strtotime('+100 years')),
'min' => $matches[1],
];
}
elseif (empty($matches[1]) && !empty($matches[2])) {
$item = [
date('U', 0),
$matches[2],
0 => date('U', 0),
1 => $matches[2],
'max' => $matches[2],
];
}
Expand Down
4 changes: 2 additions & 2 deletions src/Plugin/facets/widget/YearRangeWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ public function build(FacetInterface $facet): array {
$max = reset($active)['max'] ?? NULL;

/*if (isset($min) || empty($min)) {
$min = 0;
$min = 0;
}
if (isset($max) || empty($max)) {
$max = date("Y");
$max = date("Y");
}*/

$build['#items'] = [
Expand Down

0 comments on commit c54c8fe

Please sign in to comment.