| @@ -12,14 +12,13 @@ | ||
| 12 | 12 | /** |
| 13 | 13 | * Class FormRules. |
| 14 | 14 | */ |
| 15 | 15 | class FormRules { |
| 16 | - | |
| 17 | 16 | /** |
| 18 | 17 | * Creates greaterThan validator parts for addRule form method. |
| 19 | 18 | * |
| 20 | 19 | * @param float $threshold Threshold. |
| 21 | - * @return array | |
| 20 | + * @return array{array{class-string<FormValidators>, 'greaterThan'}, string, float} | |
| 22 | 21 | */ |
| 23 | 22 | public static function getGreaterThanParameters( float $threshold ): array { |
| 24 | 23 | return [ |
| 25 | 24 | [ FormValidators::class, 'greaterThan' ], |
| @@ -25,7 +24,19 @@ | ||
| 25 | 24 | [ FormValidators::class, 'greaterThan' ], |
| 26 | 25 | // translators: %d is numeric threshold. |
| 27 | 26 | __( 'Enter number greater than %d', 'packeta' ), |
| 28 | 27 | $threshold, |
| 28 | + ]; | |
| 29 | + } | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * Creates date validator parts for addRule form method. | |
| 33 | + * | |
| 34 | + * @return array{array{class-string<FormValidators>, 'dateIsInMysqlFormat'}, string} | |
| 35 | + */ | |
| 36 | + public static function getDateParameters(): array { | |
| 37 | + return [ | |
| 38 | + [ FormValidators::class, 'dateIsInMysqlFormat' ], | |
| 39 | + __( 'Please enter date in proper format.', 'packeta' ), | |
| 29 | 40 | ]; |
| 30 | 41 | } |
| 31 | 42 | } |