1 | <?php |
||
7 | class ExpirationDateValidator |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $year; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $month; |
||
18 | |||
19 | /** |
||
20 | * ExpirationDateValidator constructor. |
||
21 | * |
||
22 | * @param string $year |
||
23 | * @param string $month |
||
24 | */ |
||
25 | 4 | public function __construct(string $year, string $month) |
|
30 | |||
31 | /** |
||
32 | * @param string $year |
||
33 | * @param string $month |
||
34 | * |
||
35 | * @return mixed |
||
36 | */ |
||
37 | 1 | public static function validate(string $year, string $month) |
|
41 | |||
42 | /** |
||
43 | * @return bool |
||
44 | */ |
||
45 | 4 | public function isValid() |
|
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | */ |
||
55 | 4 | protected function month() |
|
59 | |||
60 | /** |
||
61 | * @return bool |
||
62 | */ |
||
63 | 4 | protected function isValidYear() |
|
68 | |||
69 | /** |
||
70 | * @return bool |
||
71 | */ |
||
72 | 4 | protected function isValidMonth() |
|
78 | |||
79 | /** |
||
80 | * @return bool |
||
81 | */ |
||
82 | 4 | protected function isFeatureDate() |
|
88 | } |
||
89 |