From c54c8fe1026eebddd854f3b3bbd7a4c840637d4a Mon Sep 17 00:00:00 2001 From: Kyle Huynh Date: Thu, 8 Jun 2023 01:17:25 -0400 Subject: [PATCH] Fully inspect the module with phpstan, phpcs, phpcbf --- css/facets_year_range.css | 8 ++++---- src/Plugin/facets/processor/YearRangeProcessor.php | 12 ++++++------ src/Plugin/facets/widget/YearRangeWidget.php | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/css/facets_year_range.css b/css/facets_year_range.css index 71b4fe4..273aecb 100644 --- a/css/facets_year_range.css +++ b/css/facets_year_range.css @@ -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; } diff --git a/src/Plugin/facets/processor/YearRangeProcessor.php b/src/Plugin/facets/processor/YearRangeProcessor.php index 644f671..3339a7c 100755 --- a/src/Plugin/facets/processor/YearRangeProcessor.php +++ b/src/Plugin/facets/processor/YearRangeProcessor.php @@ -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], ]; } diff --git a/src/Plugin/facets/widget/YearRangeWidget.php b/src/Plugin/facets/widget/YearRangeWidget.php index 420e159..dfc633c 100644 --- a/src/Plugin/facets/widget/YearRangeWidget.php +++ b/src/Plugin/facets/widget/YearRangeWidget.php @@ -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'] = [