summaryrefslogtreecommitdiff
path: root/ext/intl/calendar
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2021-02-05 20:57:57 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2021-02-09 13:37:24 +0100
commitc6723728dff93c6d4276d32cac7bf2b8465be93a (patch)
tree5885b48a16e37b21a00814ce91e763b8e81dc7c5 /ext/intl/calendar
parent99b08ac2817672c108149a65509c79baf261e819 (diff)
downloadphp-git-c6723728dff93c6d4276d32cac7bf2b8465be93a.tar.gz
Generate ext/intl class entries from stubs
Closes GH-6670
Diffstat (limited to 'ext/intl/calendar')
-rw-r--r--ext/intl/calendar/calendar.stub.php2
-rw-r--r--ext/intl/calendar/calendar_arginfo.h23
-rw-r--r--ext/intl/calendar/calendar_class.cpp11
3 files changed, 26 insertions, 10 deletions
diff --git a/ext/intl/calendar/calendar.stub.php b/ext/intl/calendar/calendar.stub.php
index 3da6ebb1d0..68a2050c3a 100644
--- a/ext/intl/calendar/calendar.stub.php
+++ b/ext/intl/calendar/calendar.stub.php
@@ -1,6 +1,6 @@
<?php
-/** @generate-function-entries */
+/** @generate-class-entries */
class IntlCalendar
{
diff --git a/ext/intl/calendar/calendar_arginfo.h b/ext/intl/calendar/calendar_arginfo.h
index 8537836d5b..78bd855bdc 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: 18a92d3af801f11e5c3b90e5d272fd98b3515c40 */
+ * Stub hash: a0800bd27fe214cce7420e689e9d7b519a7b6835 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlCalendar___construct, 0, 0, 0)
ZEND_END_ARG_INFO()
@@ -270,3 +270,24 @@ static const zend_function_entry class_IntlGregorianCalendar_methods[] = {
ZEND_ME_MAPPING(isLeapYear, intlgregcal_is_leap_year, arginfo_class_IntlGregorianCalendar_isLeapYear, ZEND_ACC_PUBLIC)
ZEND_FE_END
};
+
+zend_class_entry *register_class_IntlCalendar()
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_CLASS_ENTRY(ce, "IntlCalendar", class_IntlCalendar_methods);
+ class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+ return class_entry;
+}
+
+zend_class_entry *register_class_IntlGregorianCalendar(zend_class_entry *class_entry_IntlCalendar)
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_CLASS_ENTRY(ce, "IntlGregorianCalendar", class_IntlGregorianCalendar_methods);
+ class_entry = zend_register_internal_class_ex(&ce, class_entry_IntlCalendar);
+
+ return class_entry;
+}
+
diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp
index a46ef62e68..8c1bdf3185 100644
--- a/ext/intl/calendar/calendar_class.cpp
+++ b/ext/intl/calendar/calendar_class.cpp
@@ -268,12 +268,9 @@ static zend_object *Calendar_object_create(zend_class_entry *ce)
*/
void calendar_register_IntlCalendar_class(void)
{
- zend_class_entry ce;
-
/* Create and register 'IntlCalendar' class. */
- INIT_CLASS_ENTRY(ce, "IntlCalendar", class_IntlCalendar_methods);
- ce.create_object = Calendar_object_create;
- Calendar_ce_ptr = zend_register_internal_class(&ce);
+ Calendar_ce_ptr = register_class_IntlCalendar();
+ Calendar_ce_ptr->create_object = Calendar_object_create;
memcpy( &Calendar_handlers, &std_object_handlers,
sizeof Calendar_handlers);
@@ -331,8 +328,6 @@ void calendar_register_IntlCalendar_class(void)
CALENDAR_DECL_LONG_CONST("WALLTIME_NEXT_VALID", UCAL_WALLTIME_NEXT_VALID);
/* Create and register 'IntlGregorianCalendar' class. */
- INIT_CLASS_ENTRY(ce, "IntlGregorianCalendar", class_IntlGregorianCalendar_methods);
- GregorianCalendar_ce_ptr = zend_register_internal_class_ex(&ce,
- Calendar_ce_ptr);
+ GregorianCalendar_ce_ptr = register_class_IntlGregorianCalendar(Calendar_ce_ptr);
}
/* }}} */