1 | <?php |
||
24 | class Date extends Variadic implements DateTimeInterface, DayInterface |
||
25 | { |
||
26 | use DayTrait; |
||
27 | |||
28 | /** |
||
29 | * @var Year |
||
30 | */ |
||
31 | protected $year; |
||
32 | |||
33 | /** |
||
34 | * @var Month |
||
35 | */ |
||
36 | protected $month; |
||
37 | |||
38 | /** |
||
39 | * @var Day |
||
40 | */ |
||
41 | protected $day; |
||
42 | |||
43 | /** |
||
44 | * @param Year $year |
||
45 | * @param Month $month |
||
46 | * @param Day $day |
||
47 | */ |
||
48 | 24 | public function __construct(Year $year, Month $month, Day $day) |
|
57 | |||
58 | /** |
||
59 | * @return static |
||
60 | */ |
||
61 | 10 | public static function now() |
|
65 | |||
66 | /** |
||
67 | * @param \DateTime $dateTime |
||
68 | * @return static |
||
69 | */ |
||
70 | 13 | public static function fromNative(\DateTime $dateTime) |
|
78 | |||
79 | /** |
||
80 | * @return string |
||
81 | */ |
||
82 | 11 | public function __toString() |
|
86 | |||
87 | /** |
||
88 | * @return int |
||
89 | */ |
||
90 | 4 | public function getValue() |
|
94 | |||
95 | /** |
||
96 | * @return Year |
||
97 | */ |
||
98 | 1 | public function getYear() |
|
102 | |||
103 | /** |
||
104 | * @return Month |
||
105 | */ |
||
106 | 1 | public function getMonth() |
|
110 | |||
111 | /** |
||
112 | * @return Day |
||
113 | */ |
||
114 | 1 | public function getDay() |
|
118 | |||
119 | /** |
||
120 | * @return bool |
||
121 | */ |
||
122 | 2 | public function isWeekend() |
|
126 | |||
127 | /** |
||
128 | * @return bool |
||
129 | */ |
||
130 | 1 | public function isWeekDay() |
|
134 | |||
135 | /** |
||
136 | * @return bool |
||
137 | */ |
||
138 | 1 | public function isLeap() |
|
142 | } |
||
143 |