| Total Complexity | 5 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | #[Attribute(Attribute::TARGET_PROPERTY)] |
||
| 15 | class DateTimeCompare extends AbstractRule |
||
| 16 | { |
||
| 17 | const MESSAGE = 'The date/time should be %s `%s`'; |
||
| 18 | |||
| 19 | use Comparator; |
||
| 20 | |||
| 21 | public function __construct( |
||
| 22 | private string $operator, |
||
| 23 | private string $datetime, |
||
| 24 | ?string $message = null, |
||
| 25 | ?int $stopOnFailure = null, |
||
| 26 | ?int $priority = null |
||
| 27 | ) { |
||
| 28 | parent::__construct($message, $stopOnFailure, $priority); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function isValid($input, array $context = []): bool |
||
| 43 | } |
||
| 44 | } |
||
| 45 | |||
| 46 | public function translatedMessage(): ?string |
||
| 52 |