2121use IntlCalendar ;
2222use IntlDateFormatter ;
2323use Locale ;
24+ use ReturnTypeWillChange ;
2425
2526/**
26- * Class Time
27- *
2827 * A localized date/time package inspired
2928 * by Nesbot/Carbon and CakePHP/Chronos.
3029 *
@@ -238,13 +237,14 @@ public static function create(?int $year = null, ?int $month = null, ?int $day =
238237 *
239238 * @return Time
240239 */
241- public static function createFromFormat ($ format , $ datetime , $ timeZone = null )
240+ #[ReturnTypeWillChange]
241+ public static function createFromFormat ($ format , $ datetime , $ timezone = null )
242242 {
243243 if (! $ date = parent ::createFromFormat ($ format , $ datetime )) {
244244 throw I18nException::forInvalidFormat ($ format );
245245 }
246246
247- return new self ($ date ->format ('Y-m-d H:i:s ' ), $ timeZone );
247+ return new self ($ date ->format ('Y-m-d H:i:s ' ), $ timezone );
248248 }
249249
250250 /**
@@ -679,6 +679,7 @@ protected function setValue(string $name, $value)
679679 *
680680 * @return Time
681681 */
682+ #[ReturnTypeWillChange]
682683 public function setTimezone ($ timezone )
683684 {
684685 $ timezone = $ timezone instanceof DateTimeZone ? $ timezone : new DateTimeZone ($ timezone );
@@ -695,6 +696,7 @@ public function setTimezone($timezone)
695696 *
696697 * @return Time
697698 */
699+ #[ReturnTypeWillChange]
698700 public function setTimestamp ($ timestamp )
699701 {
700702 $ time = date ('Y-m-d H:i:s ' , $ timestamp );
@@ -1181,7 +1183,7 @@ public function __isset($name): bool
11811183 /**
11821184 * This is called when we unserialize the Time object.
11831185 */
1184- public function __wakeup ()
1186+ public function __wakeup (): void
11851187 {
11861188 /**
11871189 * Prior to unserialization, this is a string.
0 commit comments