Total Complexity | 7 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
12 | class DateTimeInFuture extends AbstractValidation |
||
13 | { |
||
14 | private ?DateTimeInterface $now = null; |
||
15 | |||
16 | public function __construct(?string $message = 'The date/time should be in the future') |
||
17 | { |
||
18 | parent::__construct($message); |
||
19 | } |
||
20 | |||
21 | public function setNow(DateTimeInterface $now): void |
||
22 | { |
||
23 | $this->now = $now; |
||
24 | } |
||
25 | |||
26 | public function getNow(): DateTimeInterface |
||
29 | } |
||
30 | |||
31 | protected function isValid($input, array $context = []): bool |
||
42 | } |
||
43 | } |
||
44 | } |
||
45 |