]> granicus.if.org Git - php/commitdiff
Make IntlDateFormatter ctor $pattern nullable
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 9 Feb 2021 13:23:42 +0000 (14:23 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 9 Feb 2021 13:25:30 +0000 (14:25 +0100)
The implementation already made this argument nullable, but it
was not reflected in the stub.

ext/intl/dateformat/dateformat.stub.php
ext/intl/dateformat/dateformat_arginfo.h
ext/intl/php_intl.stub.php
ext/intl/php_intl_arginfo.h

index 22ece903c1e259b4d693591da214e9b8cb59e106..e6f9522dd4e3114e64275eaaf611739e0f7e2be0 100644 (file)
@@ -8,14 +8,14 @@ class IntlDateFormatter
      * @param IntlTimeZone|DateTimeZone|string|null $timezone
      * @param IntlCalendar|int|null $calendar
      */
-    public function __construct(?string $locale, int $dateType, int $timeType, $timezone = null, $calendar = null, string $pattern = "") {}
+    public function __construct(?string $locale, int $dateType, int $timeType, $timezone = null, $calendar = null, ?string $pattern = null) {}
 
     /**
      * @param IntlTimeZone|DateTimeZone|string|null $timezone
      * @return IntlDateFormatter|null
      * @alias datefmt_create
      */
-    public static function create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, string $pattern = "") {}
+    public static function create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, ?string $pattern = null) {}
 
     /**
      * @return int|false
index ff9fbfa6fd34850b3db083fc49e5c942bc36364e..8830fa615e8018562ad0068d552b833b1a06ba4c 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 62742b5f463272f43970e98900a89d513c4fb839 */
+ * Stub hash: faeef90c9c1324c6a25f0df36c7239ddc2b43ee4 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 3)
        ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1)
@@ -7,7 +7,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 3)
        ZEND_ARG_TYPE_INFO(0, timeType, IS_LONG, 0)
        ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null")
        ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, calendar, "null")
-       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter_create, 0, 0, 3)
@@ -16,7 +16,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter_create, 0, 0, 3)
        ZEND_ARG_TYPE_INFO(0, timeType, IS_LONG, 0)
        ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null")
        ZEND_ARG_OBJ_TYPE_MASK(0, calendar, IntlCalendar, MAY_BE_LONG|MAY_BE_NULL, "null")
-       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter_getDateType, 0, 0, 0)
index 26b7922c2c702fc09a622ca272aa0d709c66bab6..421c1ae3dc51f58432a414c6fa713b6c6ccd5948 100644 (file)
@@ -154,7 +154,7 @@ function intl_error_name(int $errorCode): string {}
 /* dateformat */
 
 /** @param IntlTimeZone|DateTimeZone|string|null $timezone */
-function datefmt_create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, string $pattern = ""): ?IntlDateFormatter {}
+function datefmt_create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, ?string $pattern = null): ?IntlDateFormatter {}
 
 function datefmt_get_datetype(IntlDateFormatter $formatter): int|false {}
 
index 57299b841fb7a80aa54b0e342554bc808c535a81..85cf63e5852749b4461c136ded574813b1fc32b2 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: c890e3cde79ffeade4623001cc369aa734812959 */
+ * Stub hash: 7600b5814e257cc334ec72fc0f4c73b6a84b2745 */
 
 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1)
        ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null")
@@ -282,7 +282,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_datefmt_create, 0, 3, IntlDateFor
        ZEND_ARG_TYPE_INFO(0, timeType, IS_LONG, 0)
        ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null")
        ZEND_ARG_OBJ_TYPE_MASK(0, calendar, IntlCalendar, MAY_BE_LONG|MAY_BE_NULL, "null")
-       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"")
+       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null")
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_datefmt_get_datetype, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)