| Conditions | 4 |
| Paths | 5 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public static function matches(object $item, array $filter): bool { |
||
| 29 | /** @var string $key */ |
||
| 30 | 1 | foreach($filter as $key => $value) { |
|
| 31 | 1 | $operator = static::getOperator($key); |
|
| 32 | 1 | $key = Strings::endsWith($key, $operator) ? Strings::before($key, $operator) : $key; |
|
| 33 | 1 | if(!eval("return \"{$item->$key}\" $operator \"$value\";")) { |
|
| 34 | 1 | return false; |
|
| 35 | } |
||
| 36 | } |
||
| 37 | 1 | return true; |
|
| 38 | } |
||
| 49 | ?> |