| 1 | <?php |
||
| 8 | class CardExpirationDate implements Rule |
||
| 9 | { |
||
| 10 | const MSG_CARD_EXPIRATION_DATE_INVALID = 'validation.credit_card.card_expiration_date_invalid'; |
||
| 11 | const MSG_CARD_EXPIRATION_DATE_FORMAT_INVALID = 'validation.credit_card.card_expiration_date_format_invalid'; |
||
| 12 | |||
| 13 | protected $message; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Date field format. |
||
| 17 | * |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | protected $format; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * CardExpirationDate constructor. |
||
| 24 | * |
||
| 25 | * @param string $format Date format |
||
| 26 | */ |
||
| 27 | 1 | public function __construct(string $format) |
|
| 32 | |||
| 33 | /** |
||
| 34 | * Determine if the validation rule passes. |
||
| 35 | * |
||
| 36 | * @param string $attribute |
||
| 37 | * @param mixed $value |
||
| 38 | * |
||
| 39 | * @return bool |
||
| 40 | */ |
||
| 41 | 1 | public function passes($attribute, $value) |
|
| 61 | |||
| 62 | /** |
||
| 63 | * Get the validation error message. |
||
| 64 | * |
||
| 65 | * @return string |
||
| 66 | */ |
||
| 67 | public function message() |
||
| 71 | } |
||
| 72 |