Conditions | 3 |
Paths | 5 |
Total Lines | 9 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | protected function evaluate($input, array $context = []): bool |
||
23 | { |
||
24 | try { |
||
25 | $now = new DateTimeImmutable(); |
||
26 | $datetime = new DateTimeImmutable($input); |
||
27 | $format = $this->sameYear ? self::CURRENT_MONTH_SAME_YEAR : self::CURRENT_MONTH; |
||
28 | return $datetime->format($format) === $now->format($format); |
||
29 | } catch (Throwable) { |
||
30 | return false; |
||
31 | } |
||
34 |