Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
23 | 29 | public function match(object|array $item, FilterInterface $filter, array $iterableFilterHandlers): bool |
|
24 | { |
||
25 | /** @var Equals $filter */ |
||
26 | |||
27 | 29 | $itemValue = ArrayHelper::getValue($item, $filter->getField()); |
|
28 | 29 | $argumentValue = $filter->getValue(); |
|
29 | |||
30 | 29 | if (!$itemValue instanceof DateTimeInterface) { |
|
31 | 26 | return $itemValue == $argumentValue; |
|
32 | } |
||
33 | |||
34 | 3 | return $argumentValue instanceof DateTimeInterface |
|
35 | 3 | && $itemValue->getTimestamp() === $argumentValue->getTimestamp(); |
|
36 | } |
||
38 |