Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
17 | 165 | public function match(array|object $item, array $arguments, array $filterHandlers): bool |
|
18 | { |
||
19 | 165 | if (count($arguments) !== 2) { |
|
20 | 28 | throw new InvalidArgumentException('$arguments should contain exactly two elements.'); |
|
21 | } |
||
22 | |||
23 | 137 | [$field, $value] = $arguments; |
|
24 | 137 | FilterDataValidationHelper::assertFieldIsString($field); |
|
25 | |||
26 | /** @var string $field */ |
||
27 | 81 | return $this->compare(ArrayHelper::getValue($item, $field), $value); |
|
28 | } |
||
30 |