Skip to content

Commit

Permalink
Fix some Quodana issues
Browse files Browse the repository at this point in the history
This is a suggested change by Quodana, a code quality tool
  • Loading branch information
phily245 committed Nov 6, 2024
1 parent 213d497 commit 40ae589
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Filters/BooleanFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace UKFast\Sieve\Filters;

use Illuminate\Database\Query\Builder;
use UKFast\Sieve\ModifiesQueries;
use UKFast\Sieve\SearchTerm;

Expand All @@ -14,17 +13,17 @@ 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;
if ($search->term() == 'false') {
$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
Expand Down

0 comments on commit 40ae589

Please sign in to comment.