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 | */ |
||
27 | public function __construct(string $year, string $month) |
||
32 | |||
33 | /** |
||
34 | 4 | * @param string $year |
|
35 | 4 | * @param string $month |
|
36 | 4 | * |
|
37 | * @return mixed |
||
38 | */ |
||
39 | public static function validate(string $year, string $month) |
||
43 | |||
44 | 4 | /** |
|
45 | * @return bool |
||
46 | 4 | */ |
|
47 | public function isValid() |
||
53 | |||
54 | 4 | /** |
|
55 | 4 | * @return string |
|
56 | 4 | */ |
|
57 | protected function month() |
||
61 | |||
62 | 4 | /** |
|
63 | * @return bool |
||
64 | 4 | */ |
|
65 | protected function isValidYear() |
||
70 | 4 | ||
71 | /** |
||
72 | 4 | * @return bool |
|
73 | */ |
||
74 | protected function isValidMonth() |
||
80 | 4 | ||
81 | 4 | /** |
|
82 | * @return bool |
||
83 | */ |
||
84 | protected function isFeatureDate() |
||
90 | } |
||
91 |