| Conditions | 6 |
| Paths | 6 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 11 | public function match(array|object $item, FilterInterface $filter, array $iterableFilterHandlers): bool |
|
| 26 | { |
||
| 27 | /** @var Between $filter */ |
||
| 28 | |||
| 29 | 11 | $value = ArrayHelper::getValue($item, $filter->field); |
|
| 30 | |||
| 31 | 11 | if (!$value instanceof DateTimeInterface) { |
|
| 32 | 6 | return $value >= $filter->minValue && $value <= $filter->maxValue; |
|
| 33 | } |
||
| 34 | |||
| 35 | 5 | return $filter->minValue instanceof DateTimeInterface |
|
| 36 | 5 | && $filter->maxValue instanceof DateTimeInterface |
|
| 37 | 5 | && $value->getTimestamp() >= $filter->minValue->getTimestamp() |
|
| 38 | 5 | && $value->getTimestamp() <= $filter->maxValue->getTimestamp(); |
|
| 39 | } |
||
| 41 |