| 1 | <?php |
||
| 8 | class ExpirationDateValidator |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string |
||
| 12 | */ |
||
| 13 | protected $year; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | protected $month; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * ExpirationDateValidator constructor. |
||
| 22 | * |
||
| 23 | * @param string $year |
||
| 24 | * @param string $month |
||
| 25 | * |
||
| 26 | * @throws \LVR\CreditCard\Exceptions\CreditCardExpirationDateException |
||
| 27 | */ |
||
| 28 | 7 | public function __construct(string $year, string $month) |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @param string $year |
||
| 40 | * @param string $month |
||
| 41 | * |
||
| 42 | * @return mixed |
||
| 43 | */ |
||
| 44 | 4 | public static function validate(string $year, string $month) |
|
| 48 | |||
| 49 | /** |
||
| 50 | * @return bool |
||
| 51 | */ |
||
| 52 | 4 | public function isValid() |
|
| 58 | |||
| 59 | /** |
||
| 60 | * @return bool |
||
| 61 | */ |
||
| 62 | 4 | protected function isValidYear() |
|
| 66 | |||
| 67 | /** |
||
| 68 | * @return bool |
||
| 69 | */ |
||
| 70 | 4 | protected function isValidMonth() |
|
| 74 | |||
| 75 | /** |
||
| 76 | * @return bool |
||
| 77 | */ |
||
| 78 | 4 | protected function isFeatureDate() |
|
| 84 | } |
||
| 85 |