Skip to content

Commit 13cebcc

Browse files
committed
fixed some type check issues
1 parent b0070c6 commit 13cebcc

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/Filter/SearchFunctions/FilterGreaterThan.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class FilterGreaterThan extends SearchFilter
99
{
1010
public function apply(): Builder
1111
{
12-
$value = ($this->filter->getDatatype() == DataType::NUMERIC) ?
12+
$value = ($this->filter->getDatatype() == DataType::NUMERIC->value) ?
1313
(float) $this->filter->getValue() : $this->filter->getValue();
1414

1515
return $this->query->where($this->filter->getId(), '>', $value);

src/Filter/SearchFunctions/FilterGreaterThanOrEqual.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class FilterGreaterThanOrEqual extends SearchFilter
99
{
1010
public function apply(): Builder
1111
{
12-
$value = ($this->filter->getDatatype() == DataType::NUMERIC) ?
12+
$value = ($this->filter->getDatatype() == DataType::NUMERIC->value) ?
1313
(float) $this->filter->getValue() : $this->filter->getValue();
1414

1515
return $this->query->where($this->filter->getId(), '>=', $value);

src/Filter/SearchFunctions/FilterLessThan.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class FilterLessThan extends SearchFilter
99
{
1010
public function apply(): Builder
1111
{
12-
$value = ($this->filter->getDatatype() == DataType::NUMERIC) ?
12+
$value = ($this->filter->getDatatype() == DataType::NUMERIC->value) ?
1313
(float) $this->filter->getValue() : $this->filter->getValue();
1414

1515
return $this->query->where($this->filter->getId(), '<', $value);

src/Filter/SearchFunctions/FilterLessThanOrEqual.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class FilterLessThanOrEqual extends SearchFilter
99
{
1010
public function apply(): Builder
1111
{
12-
$value = ($this->filter->getDatatype() == DataType::NUMERIC) ?
12+
$value = ($this->filter->getDatatype() == DataType::NUMERIC->value) ?
1313
(float) $this->filter->getValue() : $this->filter->getValue();
1414

1515
return $this->query->where($this->filter->getId(), '<=', $value);

src/Validators/FilterValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected function isValidSearchFunction(Filter $filter): bool
5555
{
5656
$searchFunction = $filter->getFn();
5757

58-
return isset($searchFunction) && in_array($searchFunction, SearchType::values());
58+
return $searchFunction && in_array($searchFunction, SearchType::values());
5959
}
6060

6161
protected function isValidDataType(Filter $filter): int

0 commit comments

Comments
 (0)