From 40ae589fd57bc6c112a6b8c5c10e8eb88696abca Mon Sep 17 00:00:00 2001 From: Phil Young Date: Wed, 6 Nov 2024 19:03:27 +0000 Subject: [PATCH] Fix some Quodana issues This is a suggested change by Quodana, a code quality tool --- src/Filters/BooleanFilter.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Filters/BooleanFilter.php b/src/Filters/BooleanFilter.php index 8dfb6ba..5dd3f32 100644 --- a/src/Filters/BooleanFilter.php +++ b/src/Filters/BooleanFilter.php @@ -2,7 +2,6 @@ namespace UKFast\Sieve\Filters; -use Illuminate\Database\Query\Builder; use UKFast\Sieve\ModifiesQueries; use UKFast\Sieve\SearchTerm; @@ -14,9 +13,9 @@ public function __construct(protected $trueVal = 1, protected $falseVal = 0) public function modifyQuery($query, SearchTerm $search): void { - $op = '='; + $operator = '='; if ($search->operator() == 'neq') { - $op = '!='; + $operator = '!='; } $searchTerm = true; @@ -24,7 +23,7 @@ public function modifyQuery($query, SearchTerm $search): void $searchTerm = false; } - $query->where($search->column(), $op, $searchTerm ? $this->trueVal : $this->falseVal); + $query->where($search->column(), $operator, $searchTerm ? $this->trueVal : $this->falseVal); } public function operators(): array