@@ -72,15 +72,15 @@ private function setTimezone(\DateTime $dateTime, ?string $timezone): \DateTime
7272 return $ dateTime ->setTimezone (new \DateTimeZone ($ timezone ));
7373 }
7474
75- public function dateTime ($ until = 'now ' , string $ timezone = null ): \DateTime
75+ public function dateTime ($ until = 'now ' , ? string $ timezone = null ): \DateTime
7676 {
7777 return $ this ->setTimezone (
7878 $ this ->getTimestampDateTime ($ this ->unixTime ($ until )),
7979 $ timezone ,
8080 );
8181 }
8282
83- public function dateTimeAD ($ until = 'now ' , string $ timezone = null ): \DateTime
83+ public function dateTimeAD ($ until = 'now ' , ? string $ timezone = null ): \DateTime
8484 {
8585 $ min = (PHP_INT_SIZE > 4 ) ? -62135597361 : -PHP_INT_MAX ;
8686
@@ -90,7 +90,7 @@ public function dateTimeAD($until = 'now', string $timezone = null): \DateTime
9090 );
9191 }
9292
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
9494 {
9595 $ start = $ this ->getTimestamp ($ from );
9696 $ end = $ this ->getTimestamp ($ until );
@@ -107,7 +107,7 @@ public function dateTimeBetween($from = '-30 years', $until = 'now', string $tim
107107 );
108108 }
109109
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
111111 {
112112 $ intervalObject = \DateInterval::createFromDateString ($ interval );
113113 $ datetime = $ from instanceof \DateTime ? $ from : new \DateTime ($ from );
@@ -120,29 +120,29 @@ public function dateTimeInInterval($from = '-30 years', string $interval = '+5 d
120120 return $ this ->dateTimeBetween ($ begin , $ end , $ timezone );
121121 }
122122
123- public function dateTimeThisWeek ($ until = 'sunday this week ' , string $ timezone = null ): \DateTime
123+ public function dateTimeThisWeek ($ until = 'sunday this week ' , ? string $ timezone = null ): \DateTime
124124 {
125125 return $ this ->dateTimeBetween ('monday this week ' , $ until , $ timezone );
126126 }
127127
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
129129 {
130130 return $ this ->dateTimeBetween ('first day of this month ' , $ until , $ timezone );
131131 }
132132
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
134134 {
135135 return $ this ->dateTimeBetween ('first day of january ' , $ until , $ timezone );
136136 }
137137
138- public function dateTimeThisDecade ($ until = 'now ' , string $ timezone = null ): \DateTime
138+ public function dateTimeThisDecade ($ until = 'now ' , ? string $ timezone = null ): \DateTime
139139 {
140140 $ year = floor (date ('Y ' ) / 10 ) * 10 ;
141141
142142 return $ this ->dateTimeBetween ("first day of january $ year " , $ until , $ timezone );
143143 }
144144
145- public function dateTimeThisCentury ($ until = 'now ' , string $ timezone = null ): \DateTime
145+ public function dateTimeThisCentury ($ until = 'now ' , ? string $ timezone = null ): \DateTime
146146 {
147147 $ year = floor (date ('Y ' ) / 100 ) * 100 ;
148148
@@ -204,7 +204,7 @@ public function century(): string
204204 return Helper::randomElement ($ this ->centuries );
205205 }
206206
207- public function timezone (string $ countryCode = null ): string
207+ public function timezone (? string $ countryCode = null ): string
208208 {
209209 if ($ countryCode ) {
210210 $ timezones = \DateTimeZone::listIdentifiers (\DateTimeZone::PER_COUNTRY , $ countryCode );
0 commit comments