| Conditions | 4 |
| Paths | 8 |
| Total Lines | 13 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | public function isValid($input, array $context = []): bool |
||
| 32 | { |
||
| 33 | try { |
||
| 34 | $other = fn() => new DateTimeImmutable($context[$this->other]); |
||
| 35 | $datetime = |
||
| 36 | $input instanceof DateTimeInterface ? |
||
| 37 | $input : |
||
| 38 | new DateTimeImmutable($input); |
||
| 39 | |||
| 40 | return array_key_exists($this->other, $context) |
||
| 41 | && $this->compare($datetime, $this->operator, $other); |
||
| 42 | } catch (Throwable) { |
||
| 43 | return false; |
||
| 44 | } |
||
| 53 |