Conditions | 4 |
Paths | 5 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
38 | public static function matches(object $item, array $filter): bool { |
||
39 | /** @var string $key */ |
||
40 | 1 | foreach($filter as $key => $value) { |
|
41 | 1 | $operator = static::getOperator($key); |
|
42 | /** @var string $key */ |
||
43 | 1 | $key = Strings::endsWith($key, $operator) ? Strings::before($key, $operator) : $key; |
|
44 | 1 | if(!eval(static::getCondition($item, $key, $operator, $value))) { |
|
45 | 1 | return false; |
|
46 | } |
||
47 | } |
||
48 | 1 | return true; |
|
49 | } |
||
60 | ?> |