| Total Complexity | 5 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
| 13 | class DateTimeFormat extends AbstractRule |
||
| 14 | { |
||
| 15 | const MESSAGE = 'Invalid date/time format, use %s'; |
||
| 16 | |||
| 17 | public function __construct( |
||
| 18 | private string $format, |
||
| 19 | ?string $message = null, |
||
| 20 | ?int $stopOnFailure = null, |
||
| 21 | ?int $priority = null |
||
| 22 | ) { |
||
| 23 | parent::__construct($message, $stopOnFailure, $priority); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function isValid($input, array $context = []): bool |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | public function translatedMessage(): ?string |
||
| 42 |