Skip to content

Commit 186f9ba

Browse files
committed
Make IntlDateFormatter ctor $pattern nullable
The implementation already made this argument nullable, but it was not reflected in the stub.
1 parent 44192ce commit 186f9ba

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

ext/intl/dateformat/dateformat.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ class IntlDateFormatter
88
* @param IntlTimeZone|DateTimeZone|string|null $timezone
99
* @param IntlCalendar|int|null $calendar
1010
*/
11-
public function __construct(?string $locale, int $dateType, int $timeType, $timezone = null, $calendar = null, string $pattern = "") {}
11+
public function __construct(?string $locale, int $dateType, int $timeType, $timezone = null, $calendar = null, ?string $pattern = null) {}
1212

1313
/**
1414
* @param IntlTimeZone|DateTimeZone|string|null $timezone
1515
* @return IntlDateFormatter|null
1616
* @alias datefmt_create
1717
*/
18-
public static function create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, string $pattern = "") {}
18+
public static function create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, ?string $pattern = null) {}
1919

2020
/**
2121
* @return int|false

ext/intl/dateformat/dateformat_arginfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 62742b5f463272f43970e98900a89d513c4fb839 */
2+
* Stub hash: faeef90c9c1324c6a25f0df36c7239ddc2b43ee4 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 3)
55
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1)
66
ZEND_ARG_TYPE_INFO(0, dateType, IS_LONG, 0)
77
ZEND_ARG_TYPE_INFO(0, timeType, IS_LONG, 0)
88
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null")
99
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, calendar, "null")
10-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"")
10+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null")
1111
ZEND_END_ARG_INFO()
1212

1313
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)
1616
ZEND_ARG_TYPE_INFO(0, timeType, IS_LONG, 0)
1717
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null")
1818
ZEND_ARG_OBJ_TYPE_MASK(0, calendar, IntlCalendar, MAY_BE_LONG|MAY_BE_NULL, "null")
19-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"")
19+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null")
2020
ZEND_END_ARG_INFO()
2121

2222
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter_getDateType, 0, 0, 0)

ext/intl/php_intl.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function intl_error_name(int $errorCode): string {}
154154
/* dateformat */
155155

156156
/** @param IntlTimeZone|DateTimeZone|string|null $timezone */
157-
function datefmt_create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, string $pattern = ""): ?IntlDateFormatter {}
157+
function datefmt_create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, ?string $pattern = null): ?IntlDateFormatter {}
158158

159159
function datefmt_get_datetype(IntlDateFormatter $formatter): int|false {}
160160

ext/intl/php_intl_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: c890e3cde79ffeade4623001cc369aa734812959 */
2+
* Stub hash: 7600b5814e257cc334ec72fc0f4c73b6a84b2745 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1)
55
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
282282
ZEND_ARG_TYPE_INFO(0, timeType, IS_LONG, 0)
283283
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null")
284284
ZEND_ARG_OBJ_TYPE_MASK(0, calendar, IntlCalendar, MAY_BE_LONG|MAY_BE_NULL, "null")
285-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 0, "\"\"")
285+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pattern, IS_STRING, 1, "null")
286286
ZEND_END_ARG_INFO()
287287

288288
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_datefmt_get_datetype, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)

0 commit comments

Comments
 (0)