Total Complexity | 5 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
12 | class DateTimeInPast extends AbstractValidation |
||
13 | { |
||
14 | private DateTimeInterface $now; |
||
15 | |||
16 | public function __construct(?string $message = 'The date/time should be in the past') |
||
20 | } |
||
21 | |||
22 | public function setNow(DateTimeInterface $now): void |
||
23 | { |
||
24 | $this->now = $now; |
||
25 | } |
||
26 | |||
27 | protected function isValid($input, array $context = []): bool |
||
38 | } |
||
39 | } |
||
41 |