Conditions | 3 |
Paths | 6 |
Total Lines | 12 |
Code Lines | 9 |
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 = new DateTimeImmutable($this->datetime); |
||
35 | $datetime = |
||
36 | $input instanceof DateTimeInterface ? |
||
37 | $input : |
||
38 | new DateTimeImmutable($input); |
||
39 | |||
40 | return $this->compare($datetime, $this->operator, $other); |
||
41 | } catch (Throwable) { |
||
42 | return false; |
||
43 | } |
||
52 |