Skip to content

Commit

Permalink
Merge pull request #47 from ans-group/fix-quodna-issues
Browse files Browse the repository at this point in the history
Fix Quodana issues
  • Loading branch information
phily245 authored Nov 6, 2024
2 parents 023a497 + 1544274 commit 9e57f24
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 9e57f24

Please sign in to comment.