| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4.0092 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 2 | public function match(array $item, array $arguments, array $filterProcessors): bool |
|
| 19 | { |
||
| 20 | 2 | $results = []; |
|
| 21 | 2 | foreach ($arguments[0] as $subFilter) { |
|
| 22 | 2 | $operation = array_shift($subFilter); |
|
| 23 | |||
| 24 | 2 | $processor = $filterProcessors[$operation] ?? null; |
|
| 25 | 2 | if ($processor === null) { |
|
| 26 | throw new \RuntimeException(sprintf('Operation "%s" is not supported', $operation)); |
||
| 27 | } |
||
| 28 | /* @var $processor IterableProcessorInterface */ |
||
| 29 | 2 | $result = $processor->match($item, $subFilter, $filterProcessors); |
|
| 30 | 2 | if(is_bool($this->checkResult($result))) { |
|
| 31 | 2 | return $result; |
|
| 32 | } |
||
| 33 | 2 | $results[] = $result; |
|
| 34 | } |
||
| 35 | |||
| 36 | 2 | return $this->checkResults($results); |
|
| 37 | } |
||
| 41 |