@@ -72,15 +72,15 @@ private function setTimezone(\DateTime $dateTime, ?string $timezone): \DateTime
72
72
return $ dateTime ->setTimezone (new \DateTimeZone ($ timezone ));
73
73
}
74
74
75
- public function dateTime ($ until = 'now ' , string $ timezone = null ): \DateTime
75
+ public function dateTime ($ until = 'now ' , ? string $ timezone = null ): \DateTime
76
76
{
77
77
return $ this ->setTimezone (
78
78
$ this ->getTimestampDateTime ($ this ->unixTime ($ until )),
79
79
$ timezone ,
80
80
);
81
81
}
82
82
83
- public function dateTimeAD ($ until = 'now ' , string $ timezone = null ): \DateTime
83
+ public function dateTimeAD ($ until = 'now ' , ? string $ timezone = null ): \DateTime
84
84
{
85
85
$ min = (PHP_INT_SIZE > 4 ) ? -62135597361 : -PHP_INT_MAX ;
86
86
@@ -90,7 +90,7 @@ public function dateTimeAD($until = 'now', string $timezone = null): \DateTime
90
90
);
91
91
}
92
92
93
- public function dateTimeBetween ($ from = '-30 years ' , $ until = 'now ' , string $ timezone = null ): \DateTime
93
+ public function dateTimeBetween ($ from = '-30 years ' , $ until = 'now ' , ? string $ timezone = null ): \DateTime
94
94
{
95
95
$ start = $ this ->getTimestamp ($ from );
96
96
$ end = $ this ->getTimestamp ($ until );
@@ -107,7 +107,7 @@ public function dateTimeBetween($from = '-30 years', $until = 'now', string $tim
107
107
);
108
108
}
109
109
110
- public function dateTimeInInterval ($ from = '-30 years ' , string $ interval = '+5 days ' , string $ timezone = null ): \DateTime
110
+ public function dateTimeInInterval ($ from = '-30 years ' , string $ interval = '+5 days ' , ? string $ timezone = null ): \DateTime
111
111
{
112
112
$ intervalObject = \DateInterval::createFromDateString ($ interval );
113
113
$ datetime = $ from instanceof \DateTime ? $ from : new \DateTime ($ from );
@@ -120,29 +120,29 @@ public function dateTimeInInterval($from = '-30 years', string $interval = '+5 d
120
120
return $ this ->dateTimeBetween ($ begin , $ end , $ timezone );
121
121
}
122
122
123
- public function dateTimeThisWeek ($ until = 'sunday this week ' , string $ timezone = null ): \DateTime
123
+ public function dateTimeThisWeek ($ until = 'sunday this week ' , ? string $ timezone = null ): \DateTime
124
124
{
125
125
return $ this ->dateTimeBetween ('monday this week ' , $ until , $ timezone );
126
126
}
127
127
128
- public function dateTimeThisMonth ($ until = 'last day of this month ' , string $ timezone = null ): \DateTime
128
+ public function dateTimeThisMonth ($ until = 'last day of this month ' , ? string $ timezone = null ): \DateTime
129
129
{
130
130
return $ this ->dateTimeBetween ('first day of this month ' , $ until , $ timezone );
131
131
}
132
132
133
- public function dateTimeThisYear ($ until = 'last day of december ' , string $ timezone = null ): \DateTime
133
+ public function dateTimeThisYear ($ until = 'last day of december ' , ? string $ timezone = null ): \DateTime
134
134
{
135
135
return $ this ->dateTimeBetween ('first day of january ' , $ until , $ timezone );
136
136
}
137
137
138
- public function dateTimeThisDecade ($ until = 'now ' , string $ timezone = null ): \DateTime
138
+ public function dateTimeThisDecade ($ until = 'now ' , ? string $ timezone = null ): \DateTime
139
139
{
140
140
$ year = floor (date ('Y ' ) / 10 ) * 10 ;
141
141
142
142
return $ this ->dateTimeBetween ("first day of january $ year " , $ until , $ timezone );
143
143
}
144
144
145
- public function dateTimeThisCentury ($ until = 'now ' , string $ timezone = null ): \DateTime
145
+ public function dateTimeThisCentury ($ until = 'now ' , ? string $ timezone = null ): \DateTime
146
146
{
147
147
$ year = floor (date ('Y ' ) / 100 ) * 100 ;
148
148
@@ -204,7 +204,7 @@ public function century(): string
204
204
return Helper::randomElement ($ this ->centuries );
205
205
}
206
206
207
- public function timezone (string $ countryCode = null ): string
207
+ public function timezone (? string $ countryCode = null ): string
208
208
{
209
209
if ($ countryCode ) {
210
210
$ timezones = \DateTimeZone::listIdentifiers (\DateTimeZone::PER_COUNTRY , $ countryCode );
0 commit comments