| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 9 | public function match(object|array $item, FilterInterface $filter, array $iterableFilterHandlers): bool |
|
| 24 | { |
||
| 25 | /** @var All $filter */ |
||
| 26 | |||
| 27 | 9 | foreach ($filter->getFilters() as $subFilter) { |
|
|
|
|||
| 28 | 9 | $filterHandler = $iterableFilterHandlers[$subFilter::class] ?? null; |
|
| 29 | 9 | if ($filterHandler === null) { |
|
| 30 | 1 | throw new LogicException(sprintf('Filter "%s" is not supported.', $subFilter::class)); |
|
| 31 | } |
||
| 32 | 8 | if (!$filterHandler->match($item, $subFilter, $iterableFilterHandlers)) { |
|
| 33 | 6 | return false; |
|
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | 4 | return true; |
|
| 38 | } |
||
| 40 |