From 6f11974e0c3bed4daa5d1144e90211aae439f9df Mon Sep 17 00:00:00 2001 From: Tom Kaminski Date: Fri, 9 Feb 2024 16:02:37 -0600 Subject: [PATCH] php 8.1 compatibility: Parameters dateType and timeType are now optional --- IntlDateFormatter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IntlDateFormatter.php b/IntlDateFormatter.php index e878fe6..9d0ae0f 100644 --- a/IntlDateFormatter.php +++ b/IntlDateFormatter.php @@ -142,7 +142,7 @@ abstract class IntlDateFormatter * @throws MethodArgumentValueNotImplementedException When $locale different than "en" or null is passed * @throws MethodArgumentValueNotImplementedException When $calendar different than GREGORIAN is passed */ - public function __construct(?string $locale, ?int $dateType, ?int $timeType, $timezone = null, $calendar = null, ?string $pattern = '') + public function __construct(?string $locale, ?int $dateType = IntlDateFormatter::FULL, ?int $timeType = IntlDateFormatter::FULL, $timezone = null, $calendar = null, ?string $pattern = '') { if ('en' !== $locale && null !== $locale) { throw new MethodArgumentValueNotImplementedException(__METHOD__, 'locale', $locale, 'Only the locale "en" is supported'); @@ -193,7 +193,7 @@ public function __construct(?string $locale, ?int $dateType, ?int $timeType, $ti * @throws MethodArgumentValueNotImplementedException When $locale different than "en" or null is passed * @throws MethodArgumentValueNotImplementedException When $calendar different than GREGORIAN is passed */ - public static function create(?string $locale, ?int $dateType, ?int $timeType, $timezone = null, int $calendar = null, ?string $pattern = '') + public static function create(?string $locale, ?int $dateType = IntlDateFormatter::FULL, ?int $timeType = IntlDateFormatter::FULL, $timezone = null, int $calendar = null, ?string $pattern = '') { return new static($locale, $dateType, $timeType, $timezone, $calendar, $pattern); }