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