1 | <?php |
||
8 | class CardExpirationMonth implements Rule |
||
9 | { |
||
10 | const MSG_CARD_EXPIRATION_MONT_INVALID = 'validation.credit_card.card_expiation_month_invalid'; |
||
11 | |||
12 | /** |
||
13 | * Year field name. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $year; |
||
18 | |||
19 | /** |
||
20 | * CardExpirationMonth constructor. |
||
21 | * |
||
22 | * @param string $year |
||
23 | */ |
||
24 | 1 | public function __construct(string $year) |
|
28 | |||
29 | /** |
||
30 | * Determine if the validation rule passes. |
||
31 | * |
||
32 | * @param string $attribute |
||
33 | * @param mixed $value |
||
34 | * |
||
35 | * @return bool |
||
36 | */ |
||
37 | 1 | public function passes($attribute, $value) |
|
41 | |||
42 | /** |
||
43 | * Get the validation error message. |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | 1 | public function message() |
|
51 | } |
||
52 |