diff --git a/src/Filter/StringFilter.php b/src/Filter/StringFilter.php index 60389e5e..be45a81a 100644 --- a/src/Filter/StringFilter.php +++ b/src/Filter/StringFilter.php @@ -55,7 +55,7 @@ protected function filter(ProxyQueryInterface $query, string $field, FilterData return; } - $value = trim($data->getValue()); + $value = trim((string) $data->getValue()); if ('' === $value) { return; diff --git a/tests/Filter/CallbackFilterTest.php b/tests/Filter/CallbackFilterTest.php index fb660af5..25a26acc 100644 --- a/tests/Filter/CallbackFilterTest.php +++ b/tests/Filter/CallbackFilterTest.php @@ -57,7 +57,7 @@ public function testFilterMethodEmpty(): void $filter = new CallbackFilter(); $filter->initialize('field_name', [ 'field_name' => self::DEFAULT_FIELD_NAME, - 'callback' => [$this, 'customCallback'], + 'callback' => $this->customCallback(...), ]); $filter->apply($builder, FilterData::fromArray([])); @@ -72,7 +72,7 @@ public function testFilterMethodNotEmpty(): void $filter = new CallbackFilter(); $filter->initialize('field_name', [ 'field_name' => self::DEFAULT_FIELD_NAME, - 'callback' => [$this, 'customCallback'], + 'callback' => $this->customCallback(...), ]); $filter->apply($builder, FilterData::fromArray(['value' => 'myValue']));