Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | 157 | public function match(array $item, array $arguments, array $filterProcessors): bool |
|
23 | { |
||
24 | 157 | if (count($arguments) !== 2) { |
|
25 | 28 | throw new InvalidArgumentException('$arguments should contain exactly two elements.'); |
|
26 | } |
||
27 | |||
28 | 129 | [$field, $value] = $arguments; |
|
29 | 129 | FilterDataValidationHelper::assertFieldIsString($field); |
|
30 | |||
31 | /** @var string $field */ |
||
32 | 73 | return array_key_exists($field, $item) && $this->compare($item[$field], $value); |
|
33 | } |
||
35 |