Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
25 | 6 | public function match(object|array $item, FilterInterface $filter, array $iterableFilterHandlers): bool |
|
26 | { |
||
27 | 6 | if (!$filter instanceof In) { |
|
28 | 1 | throw new InvalidArgumentException('Incorrect filter.'); |
|
29 | } |
||
30 | |||
31 | 5 | $itemValue = ArrayHelper::getValue($item, $filter->field); |
|
32 | 5 | $argumentValue = $filter->getValues(); |
|
33 | |||
34 | 5 | return in_array($itemValue, $argumentValue); |
|
35 | } |
||
37 |