| 1 | <?php |
||
| 20 | class DateRule extends AbstractRule |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var string date format |
||
| 24 | */ |
||
| 25 | protected $format = null; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Setup validation rule |
||
| 29 | * |
||
| 30 | * @param string $format |
||
| 31 | */ |
||
| 32 | 8 | public function __construct($format = null) |
|
| 36 | |||
| 37 | /** |
||
| 38 | * Check input data |
||
| 39 | * |
||
| 40 | * @param mixed $input |
||
| 41 | * |
||
| 42 | * @return bool |
||
| 43 | */ |
||
| 44 | 8 | public function validate($input): bool |
|
| 59 | |||
| 60 | /** |
||
| 61 | * Get error template |
||
| 62 | * |
||
| 63 | * @return string |
||
| 64 | */ |
||
| 65 | 6 | public function getDescription() : string |
|
| 72 | } |
||
| 73 |