Conditions | 3 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
27 | 7 | public function match(object|array $item, FilterInterface $filter, array $iterableFilterHandlers): bool |
|
28 | { |
||
29 | 7 | if (!$filter instanceof Like) { |
|
30 | 1 | throw new InvalidArgumentException('Incorrect filter.'); |
|
31 | } |
||
32 | |||
33 | 6 | $itemValue = ArrayHelper::getValue($item, $filter->field); |
|
34 | 6 | $argumentValue = $filter->value; |
|
35 | |||
36 | 6 | return is_string($itemValue) && stripos($itemValue, $argumentValue) !== false; |
|
37 | } |
||
39 |