diff --git a/system/I18n/Time.php b/system/I18n/Time.php index 27d6ccc3ad5c..919a5a391534 100644 --- a/system/I18n/Time.php +++ b/system/I18n/Time.php @@ -21,10 +21,9 @@ use IntlCalendar; use IntlDateFormatter; use Locale; +use ReturnTypeWillChange; /** - * Class Time - * * A localized date/time package inspired * by Nesbot/Carbon and CakePHP/Chronos. * @@ -232,19 +231,20 @@ public static function create(?int $year = null, ?int $month = null, ?int $day = * * @param string $format * @param string $datetime - * @param DateTimeZone|string|null $timeZone + * @param DateTimeZone|string|null $timezone * * @throws Exception * * @return Time */ - public static function createFromFormat($format, $datetime, $timeZone = null) + #[ReturnTypeWillChange] + public static function createFromFormat($format, $datetime, $timezone = null) { if (! $date = parent::createFromFormat($format, $datetime)) { throw I18nException::forInvalidFormat($format); } - return new self($date->format('Y-m-d H:i:s'), $timeZone); + return new self($date->format('Y-m-d H:i:s'), $timezone); } /** @@ -679,6 +679,7 @@ protected function setValue(string $name, $value) * * @return Time */ + #[ReturnTypeWillChange] public function setTimezone($timezone) { $timezone = $timezone instanceof DateTimeZone ? $timezone : new DateTimeZone($timezone); @@ -695,6 +696,7 @@ public function setTimezone($timezone) * * @return Time */ + #[ReturnTypeWillChange] public function setTimestamp($timestamp) { $time = date('Y-m-d H:i:s', $timestamp); @@ -1181,7 +1183,7 @@ public function __isset($name): bool /** * This is called when we unserialize the Time object. */ - public function __wakeup() + public function __wakeup(): void { /** * Prior to unserialization, this is a string.