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 $year |
||
33 | * |
||
34 | * @return $this |
||
35 | */ |
||
36 | protected function setYear($year) |
||
48 | 4 | ||
49 | 4 | /** |
|
50 | * @param string $year |
||
51 | * @param string $month |
||
52 | * |
||
53 | * @return mixed |
||
54 | */ |
||
55 | 4 | public static function validate(string $year, string $month) |
|
59 | |||
60 | /** |
||
61 | * @return bool |
||
62 | */ |
||
63 | 4 | public function isValid() |
|
69 | |||
70 | /** |
||
71 | * @return string |
||
72 | 4 | */ |
|
73 | protected function month() |
||
77 | |||
78 | /** |
||
79 | * @return bool |
||
80 | */ |
||
81 | protected function isValidYear() |
||
88 | |||
89 | /** |
||
90 | * @return bool |
||
91 | */ |
||
92 | protected function isValidMonth() |
||
98 | |||
99 | /** |
||
100 | * @return bool |
||
101 | */ |
||
102 | protected function isFeatureDate() |
||
108 | } |
||
109 |