summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-07-17 12:40:05 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-07-17 12:47:25 +0200
commit4903f7c5fde11a115f659ec54a1d0ede6fd7232c (patch)
tree77fe3c1fee00330aaf1636fa8af52ff030f7ad9c
parent83478d4fe0e186b4ce2505b44f73a38896dd5d71 (diff)
downloadphp-git-4903f7c5fde11a115f659ec54a1d0ede6fd7232c.tar.gz
Fix IntlGregorianCalendar constructor signature
Give these conversative UNKNOWN defaults and no types, as the overload is something of a mess.
-rw-r--r--ext/intl/calendar/calendar.stub.php2
-rw-r--r--ext/intl/calendar/calendar_arginfo.h11
-rw-r--r--ext/intl/php_intl.stub.php2
-rw-r--r--ext/intl/php_intl_arginfo.h10
-rw-r--r--ext/intl/tests/gregoriancalendar___construct_error.phpt2
5 files changed, 19 insertions, 8 deletions
diff --git a/ext/intl/calendar/calendar.stub.php b/ext/intl/calendar/calendar.stub.php
index fafee62640..d704ab77c9 100644
--- a/ext/intl/calendar/calendar.stub.php
+++ b/ext/intl/calendar/calendar.stub.php
@@ -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
diff --git a/ext/intl/calendar/calendar_arginfo.h b/ext/intl/calendar/calendar_arginfo.h
index d80500a887..5802d9f690 100644
--- a/ext/intl/calendar/calendar_arginfo.h
+++ b/ext/intl/calendar/calendar_arginfo.h
@@ -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)
diff --git a/ext/intl/php_intl.stub.php b/ext/intl/php_intl.stub.php
index 337a79c71a..9708f6d359 100644
--- a/ext/intl/php_intl.stub.php
+++ b/ext/intl/php_intl.stub.php
@@ -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 {}
diff --git a/ext/intl/php_intl_arginfo.h b/ext/intl/php_intl_arginfo.h
index 2e16d16be7..f9e2cbd152 100644
--- a/ext/intl/php_intl_arginfo.h
+++ b/ext/intl/php_intl_arginfo.h
@@ -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)
diff --git a/ext/intl/tests/gregoriancalendar___construct_error.phpt b/ext/intl/tests/gregoriancalendar___construct_error.phpt
index 1f8d90b518..dcea7aa1db 100644
--- a/ext/intl/tests/gregoriancalendar___construct_error.phpt
+++ b/ext/intl/tests/gregoriancalendar___construct_error.phpt
@@ -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