| Total Complexity | 8 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | class DateRule extends AbstractRule |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @var string date format |
||
| 25 | */ |
||
| 26 | protected $format = null; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Setup validation rule |
||
| 30 | * |
||
| 31 | * @param string|null $format |
||
| 32 | */ |
||
| 33 | 8 | public function __construct(?string $format = null) |
|
| 36 | 8 | } |
|
| 37 | |||
| 38 | /** |
||
| 39 | * Check input data |
||
| 40 | * |
||
| 41 | * @param mixed $input |
||
| 42 | * |
||
| 43 | * @return bool |
||
| 44 | */ |
||
| 45 | 8 | public function validate($input): bool |
|
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Get error template |
||
| 67 | * |
||
| 68 | * @return string |
||
| 69 | */ |
||
| 70 | 6 | public function getDescription(): string |
|
| 78 |