Total Complexity | 4 |
Total Lines | 19 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
11 | class DateTimeFormat extends AbstractValidation |
||
12 | { |
||
13 | const MESSAGE = 'Formato de data e/ou hora inválido, use %s'; |
||
14 | |||
15 | public function __construct(private string $format, ?string $message = null) |
||
16 | { |
||
17 | $this->message = $message ?? sprintf(self::MESSAGE, $this->format); |
||
18 | parent::__construct($message); |
||
19 | } |
||
20 | |||
21 | protected function isValid($input, array $context = []): bool |
||
29 | } |
||
30 | } |
||
32 |