]> granicus.if.org Git - php/commitdiff
Fix IntlGregorianCalendar constructor signature
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 17 Jul 2020 10:40:05 +0000 (12:40 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 17 Jul 2020 10:47:25 +0000 (12:47 +0200)
Give these conversative UNKNOWN defaults and no types, as the
overload is something of a mess.

ext/intl/calendar/calendar.stub.php
ext/intl/calendar/calendar_arginfo.h
ext/intl/php_intl.stub.php
ext/intl/php_intl_arginfo.h
ext/intl/tests/gregoriancalendar___construct_error.phpt

index fafee62640c68c2f77092272205dabc04bc68699..d704ab77c93468c2cda0fca72bcecb46cfda724c 100644 (file)
@@ -283,7 +283,7 @@ class IntlCalendar
 
 class IntlGregorianCalendar extends IntlCalendar
 {
-    public function __construct() {}
+    public function __construct($timeZoneOrYear = UNKNOWN, $localeOrMonth = UNKNOWN, $dayOfMonth = UNKNOWN, $hour = UNKNOWN, $minute = UNKNOWN, $second = UNKNOWN) {}
 
     /**
      * @return bool
index d80500a88721f20cceca3a6b1626c0f575244f38..5802d9f690e0a2f0b9c5a3abe18fb97762355054 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: e9aea4eb45aba216347d3cf821cf5adebc217ba1 */
+ * Stub hash: 7261d52837a7ac393453511d2c29ee9106407236 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlCalendar___construct, 0, 0, 0)
 ZEND_END_ARG_INFO()
@@ -142,7 +142,14 @@ ZEND_END_ARG_INFO()
 
 #define arginfo_class_IntlCalendar_toDateTime arginfo_class_IntlCalendar___construct
 
-#define arginfo_class_IntlGregorianCalendar___construct arginfo_class_IntlCalendar___construct
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlGregorianCalendar___construct, 0, 0, 0)
+       ZEND_ARG_INFO(0, timeZoneOrYear)
+       ZEND_ARG_INFO(0, localeOrMonth)
+       ZEND_ARG_INFO(0, dayOfMonth)
+       ZEND_ARG_INFO(0, hour)
+       ZEND_ARG_INFO(0, minute)
+       ZEND_ARG_INFO(0, second)
+ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlGregorianCalendar_setGregorianChange, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, change, IS_DOUBLE, 0)
index 337a79c71afef23bfaf1b5d28e4c062325eceda2..9708f6d35973bc9044af2917807889a5b2ee795c 100644 (file)
@@ -99,7 +99,7 @@ function intlcal_get_error_code(IntlCalendar $calendar): int|false {}
 function intlcal_get_error_message(IntlCalendar $calendar): string|false {}
 
 /** @param IntlTimeZone|DateTimeZone|string|null $timeZone */
-function intlgregcal_create_instance($timeZone = null, ?string $locale = null): ?IntlGregorianCalendar {}
+function intlgregcal_create_instance($timeZoneOrYear = UNKNOWN, $localeOrMonth = UNKNOWN, $dayOfMonth = UNKNOWN, $hour = UNKNOWN, $minute = UNKNOWN, $second = UNKNOWN): ?IntlGregorianCalendar {}
 
 function intlgregcal_set_gregorian_change(IntlGregorianCalendar $calendar, float $change): bool {}
 
index 2e16d16be77689f33e3af3b40097c9a41da94074..f9e2cbd1520097949f5b0d994edc081ec329aa3b 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: f5411cdc67ac288183c4210932b222c406bfe254 */
+ * Stub hash: 6130944985187815dd839f7425213f91c3261735 */
 
 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")
@@ -179,8 +179,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_intlcal_get_error_message, 0, 1,
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlgregcal_create_instance, 0, 0, IntlGregorianCalendar, 1)
-       ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timeZone, "null")
-       ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, locale, IS_STRING, 1, "null")
+       ZEND_ARG_INFO(0, timeZoneOrYear)
+       ZEND_ARG_INFO(0, localeOrMonth)
+       ZEND_ARG_INFO(0, dayOfMonth)
+       ZEND_ARG_INFO(0, hour)
+       ZEND_ARG_INFO(0, minute)
+       ZEND_ARG_INFO(0, second)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_intlgregcal_set_gregorian_change, 0, 2, _IS_BOOL, 0)
index 1f8d90b518b74af308476bc34e61dffd92465bf3..dcea7aa1db51477893f2ea8845421c7528e25cd5 100644 (file)
@@ -38,4 +38,4 @@ Too many arguments
 Too many arguments
 No variant with 4 arguments (excluding trailing NULLs)
 No variant with 4 arguments (excluding trailing NULLs)
-IntlGregorianCalendar::__construct(): Argument #6 must be of type int, array given
+IntlGregorianCalendar::__construct(): Argument #6 ($second) must be of type int, array given