Skip to content

Commit 6208fa2

Browse files
committed
Generate ext/intl class entries from stubs
1 parent 320843f commit 6208fa2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+321
-152
lines changed

ext/intl/breakiterator/breakiterator.stub.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
22

3-
/** @generate-function-entries */
3+
/**
4+
* @generate-function-entries
5+
* @generate-class-entries
6+
*/
47

58
class IntlBreakIterator implements IteratorAggregate
69
{
@@ -86,12 +89,6 @@ public function getRuleStatus() {}
8689
public function getRuleStatusVec() {}
8790
}
8891

89-
class IntlPartsIterator extends IntlIterator
90-
{
91-
/** @return IntlBreakIterator */
92-
public function getBreakIterator() {}
93-
}
94-
9592
class IntlCodePointBreakIterator extends IntlBreakIterator
9693
{
9794
/** @return int */

ext/intl/breakiterator/breakiterator_arginfo.h

Lines changed: 33 additions & 10 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: 6a121ed9817667820f05677a772781d6b788796b */
2+
* Stub hash: 4fe6fb9a231d635a193f61897cf4ff6f1541c0db */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlBreakIterator_createCharacterInstance, 0, 0, 0)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, locale, IS_STRING, 1, "null")
@@ -72,8 +72,6 @@ ZEND_END_ARG_INFO()
7272

7373
#define arginfo_class_IntlRuleBasedBreakIterator_getRuleStatusVec arginfo_class_IntlBreakIterator_createCodePointInstance
7474

75-
#define arginfo_class_IntlPartsIterator_getBreakIterator arginfo_class_IntlBreakIterator_createCodePointInstance
76-
7775
#define arginfo_class_IntlCodePointBreakIterator_getLastCodePoint arginfo_class_IntlBreakIterator_createCodePointInstance
7876

7977

@@ -104,7 +102,6 @@ ZEND_METHOD(IntlRuleBasedBreakIterator, getBinaryRules);
104102
ZEND_METHOD(IntlRuleBasedBreakIterator, getRules);
105103
ZEND_METHOD(IntlRuleBasedBreakIterator, getRuleStatus);
106104
ZEND_METHOD(IntlRuleBasedBreakIterator, getRuleStatusVec);
107-
ZEND_METHOD(IntlPartsIterator, getBreakIterator);
108105
ZEND_METHOD(IntlCodePointBreakIterator, getLastCodePoint);
109106

110107

@@ -145,13 +142,39 @@ static const zend_function_entry class_IntlRuleBasedBreakIterator_methods[] = {
145142
};
146143

147144

148-
static const zend_function_entry class_IntlPartsIterator_methods[] = {
149-
ZEND_ME(IntlPartsIterator, getBreakIterator, arginfo_class_IntlPartsIterator_getBreakIterator, ZEND_ACC_PUBLIC)
150-
ZEND_FE_END
151-
};
152-
153-
154145
static const zend_function_entry class_IntlCodePointBreakIterator_methods[] = {
155146
ZEND_ME(IntlCodePointBreakIterator, getLastCodePoint, arginfo_class_IntlCodePointBreakIterator_getLastCodePoint, ZEND_ACC_PUBLIC)
156147
ZEND_FE_END
157148
};
149+
150+
zend_class_entry *register_class_IntlBreakIterator(zend_class_entry *class_entry_IteratorAggregate)
151+
{
152+
zend_class_entry ce, *class_entry;
153+
154+
INIT_CLASS_ENTRY(ce, "IntlBreakIterator", class_IntlBreakIterator_methods);
155+
class_entry = zend_register_internal_class_ex(&ce, NULL);
156+
zend_class_implements(class_entry, 1, class_entry_IteratorAggregate);
157+
158+
return class_entry;
159+
}
160+
161+
zend_class_entry *register_class_IntlRuleBasedBreakIterator(zend_class_entry *class_entry_IntlBreakIterator)
162+
{
163+
zend_class_entry ce, *class_entry;
164+
165+
INIT_CLASS_ENTRY(ce, "IntlRuleBasedBreakIterator", class_IntlRuleBasedBreakIterator_methods);
166+
class_entry = zend_register_internal_class_ex(&ce, class_entry_IntlBreakIterator);
167+
168+
return class_entry;
169+
}
170+
171+
zend_class_entry *register_class_IntlCodePointBreakIterator(zend_class_entry *class_entry_IntlBreakIterator)
172+
{
173+
zend_class_entry ce, *class_entry;
174+
175+
INIT_CLASS_ENTRY(ce, "IntlCodePointBreakIterator", class_IntlCodePointBreakIterator_methods);
176+
class_entry = zend_register_internal_class_ex(&ce, class_entry_IntlBreakIterator);
177+
178+
return class_entry;
179+
}
180+

ext/intl/breakiterator/breakiterator_class.cpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,11 @@ static zend_object *BreakIterator_object_create(zend_class_entry *ce)
220220
*/
221221
U_CFUNC void breakiterator_register_BreakIterator_class(void)
222222
{
223-
zend_class_entry ce;
224-
225223
/* Create and register 'BreakIterator' class. */
226-
INIT_CLASS_ENTRY(ce, "IntlBreakIterator", class_IntlBreakIterator_methods);
227-
ce.create_object = BreakIterator_object_create;
228-
ce.get_iterator = _breakiterator_get_iterator;
229-
BreakIterator_ce_ptr = zend_register_internal_class(&ce);
224+
225+
BreakIterator_ce_ptr = register_class_IntlBreakIterator(zend_ce_aggregate);
226+
BreakIterator_ce_ptr->create_object = BreakIterator_object_create;
227+
BreakIterator_ce_ptr->get_iterator = _breakiterator_get_iterator;
230228

231229
memcpy(&BreakIterator_handlers, &std_object_handlers,
232230
sizeof BreakIterator_handlers);
@@ -236,8 +234,6 @@ U_CFUNC void breakiterator_register_BreakIterator_class(void)
236234
BreakIterator_handlers.get_debug_info = BreakIterator_get_debug_info;
237235
BreakIterator_handlers.free_obj = BreakIterator_objects_free;
238236

239-
zend_class_implements(BreakIterator_ce_ptr, 1, zend_ce_aggregate);
240-
241237
zend_declare_class_constant_long(BreakIterator_ce_ptr,
242238
"DONE", sizeof("DONE") - 1, BreakIterator::DONE );
243239

@@ -271,15 +267,9 @@ U_CFUNC void breakiterator_register_BreakIterator_class(void)
271267

272268

273269
/* Create and register 'RuleBasedBreakIterator' class. */
274-
INIT_CLASS_ENTRY(ce, "IntlRuleBasedBreakIterator",
275-
class_IntlRuleBasedBreakIterator_methods);
276-
RuleBasedBreakIterator_ce_ptr = zend_register_internal_class_ex(&ce,
277-
BreakIterator_ce_ptr);
270+
RuleBasedBreakIterator_ce_ptr = register_class_IntlRuleBasedBreakIterator(BreakIterator_ce_ptr);
278271

279272
/* Create and register 'CodePointBreakIterator' class. */
280-
INIT_CLASS_ENTRY(ce, "IntlCodePointBreakIterator",
281-
class_IntlCodePointBreakIterator_methods);
282-
CodePointBreakIterator_ce_ptr = zend_register_internal_class_ex(&ce,
283-
BreakIterator_ce_ptr);
273+
CodePointBreakIterator_ce_ptr = register_class_IntlCodePointBreakIterator(BreakIterator_ce_ptr);
284274
}
285275
/* }}} */

ext/intl/breakiterator/breakiterator_iterators.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
extern "C" {
2525
#define USE_BREAKITERATOR_POINTER
2626
#include "breakiterator_class.h"
27-
#include "breakiterator_arginfo.h"
27+
#include "breakiterator_iterators_arginfo.h"
2828
#include "../intl_convert.h"
2929
#include "../locale/locale.h"
3030
#include <zend_exceptions.h>
@@ -285,14 +285,10 @@ U_CFUNC PHP_METHOD(IntlPartsIterator, getBreakIterator)
285285
ZVAL_COPY_DEREF(return_value, biter_zval);
286286
}
287287

288-
U_CFUNC void breakiterator_register_IntlPartsIterator_class(void)
288+
U_CFUNC void breakiterator_register_IntlPartsIterator_class()
289289
{
290-
zend_class_entry ce;
291-
292290
/* Create and register 'BreakIterator' class. */
293-
INIT_CLASS_ENTRY(ce, "IntlPartsIterator", class_IntlPartsIterator_methods);
294-
IntlPartsIterator_ce_ptr = zend_register_internal_class_ex(&ce,
295-
IntlIterator_ce_ptr);
291+
IntlPartsIterator_ce_ptr = register_class_IntlPartsIterator(IntlIterator_ce_ptr);
296292
IntlPartsIterator_ce_ptr->create_object = IntlPartsIterator_object_create;
297293

298294
memcpy(&IntlPartsIterator_handlers, &IntlIterator_handlers,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
/**
4+
* @generate-function-entries
5+
* @generate-class-entries
6+
*/
7+
8+
class IntlPartsIterator extends IntlIterator
9+
{
10+
/** @return IntlBreakIterator */
11+
public function getBreakIterator() {}
12+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* This is a generated file, edit the .stub.php file instead.
2+
* Stub hash: db9382ccfcb8a4d4ea6d01404ece22088f8d419c */
3+
4+
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlPartsIterator_getBreakIterator, 0, 0, 0)
5+
ZEND_END_ARG_INFO()
6+
7+
8+
ZEND_METHOD(IntlPartsIterator, getBreakIterator);
9+
10+
11+
static const zend_function_entry class_IntlPartsIterator_methods[] = {
12+
ZEND_ME(IntlPartsIterator, getBreakIterator, arginfo_class_IntlPartsIterator_getBreakIterator, ZEND_ACC_PUBLIC)
13+
ZEND_FE_END
14+
};
15+
16+
zend_class_entry *register_class_IntlPartsIterator(zend_class_entry *class_entry_IntlIterator)
17+
{
18+
zend_class_entry ce, *class_entry;
19+
20+
INIT_CLASS_ENTRY(ce, "IntlPartsIterator", class_IntlPartsIterator_methods);
21+
class_entry = zend_register_internal_class_ex(&ce, class_entry_IntlIterator);
22+
23+
return class_entry;
24+
}
25+

ext/intl/calendar/calendar.stub.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
22

3-
/** @generate-function-entries */
3+
/**
4+
* @generate-function-entries
5+
* @generate-class-entries
6+
*/
47

58
class IntlCalendar
69
{

ext/intl/calendar/calendar_arginfo.h

Lines changed: 22 additions & 1 deletion
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: 18a92d3af801f11e5c3b90e5d272fd98b3515c40 */
2+
* Stub hash: 06651a7cc83f307403826af1362feca173e2ba4b */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlCalendar___construct, 0, 0, 0)
55
ZEND_END_ARG_INFO()
@@ -270,3 +270,24 @@ static const zend_function_entry class_IntlGregorianCalendar_methods[] = {
270270
ZEND_ME_MAPPING(isLeapYear, intlgregcal_is_leap_year, arginfo_class_IntlGregorianCalendar_isLeapYear, ZEND_ACC_PUBLIC)
271271
ZEND_FE_END
272272
};
273+
274+
zend_class_entry *register_class_IntlCalendar()
275+
{
276+
zend_class_entry ce, *class_entry;
277+
278+
INIT_CLASS_ENTRY(ce, "IntlCalendar", class_IntlCalendar_methods);
279+
class_entry = zend_register_internal_class_ex(&ce, NULL);
280+
281+
return class_entry;
282+
}
283+
284+
zend_class_entry *register_class_IntlGregorianCalendar(zend_class_entry *class_entry_IntlCalendar)
285+
{
286+
zend_class_entry ce, *class_entry;
287+
288+
INIT_CLASS_ENTRY(ce, "IntlGregorianCalendar", class_IntlGregorianCalendar_methods);
289+
class_entry = zend_register_internal_class_ex(&ce, class_entry_IntlCalendar);
290+
291+
return class_entry;
292+
}
293+

ext/intl/calendar/calendar_class.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,9 @@ static zend_object *Calendar_object_create(zend_class_entry *ce)
268268
*/
269269
void calendar_register_IntlCalendar_class(void)
270270
{
271-
zend_class_entry ce;
272-
273271
/* Create and register 'IntlCalendar' class. */
274-
INIT_CLASS_ENTRY(ce, "IntlCalendar", class_IntlCalendar_methods);
275-
ce.create_object = Calendar_object_create;
276-
Calendar_ce_ptr = zend_register_internal_class(&ce);
272+
Calendar_ce_ptr = register_class_IntlCalendar();
273+
Calendar_ce_ptr->create_object = Calendar_object_create;
277274

278275
memcpy( &Calendar_handlers, &std_object_handlers,
279276
sizeof Calendar_handlers);
@@ -331,8 +328,6 @@ void calendar_register_IntlCalendar_class(void)
331328
CALENDAR_DECL_LONG_CONST("WALLTIME_NEXT_VALID", UCAL_WALLTIME_NEXT_VALID);
332329

333330
/* Create and register 'IntlGregorianCalendar' class. */
334-
INIT_CLASS_ENTRY(ce, "IntlGregorianCalendar", class_IntlGregorianCalendar_methods);
335-
GregorianCalendar_ce_ptr = zend_register_internal_class_ex(&ce,
336-
Calendar_ce_ptr);
331+
GregorianCalendar_ce_ptr = register_class_IntlGregorianCalendar(Calendar_ce_ptr);
337332
}
338333
/* }}} */

ext/intl/collator/collator.stub.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
22

3-
/** @generate-function-entries */
3+
/**
4+
* @generate-function-entries
5+
* @generate-class-entries
6+
*/
47

58
class Collator
69
{

ext/intl/collator/collator_arginfo.h

Lines changed: 12 additions & 1 deletion
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: 869c6e60a8f2b153ef79f28a08e165ff3ec2bc14 */
2+
* Stub hash: 3f992cc1efe2d4f193c414ceb2811ee0945a60c5 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Collator___construct, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0)
@@ -85,3 +85,14 @@ static const zend_function_entry class_Collator_methods[] = {
8585
ZEND_ME_MAPPING(getSortKey, collator_get_sort_key, arginfo_class_Collator_getSortKey, ZEND_ACC_PUBLIC)
8686
ZEND_FE_END
8787
};
88+
89+
zend_class_entry *register_class_Collator()
90+
{
91+
zend_class_entry ce, *class_entry;
92+
93+
INIT_CLASS_ENTRY(ce, "Collator", class_Collator_methods);
94+
class_entry = zend_register_internal_class_ex(&ce, NULL);
95+
96+
return class_entry;
97+
}
98+

ext/intl/collator/collator_class.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,9 @@ zend_object *Collator_object_create(zend_class_entry *ce )
6363
*/
6464
void collator_register_Collator_class( void )
6565
{
66-
zend_class_entry ce;
67-
6866
/* Create and register 'Collator' class. */
69-
INIT_CLASS_ENTRY( ce, "Collator", class_Collator_methods );
70-
ce.create_object = Collator_object_create;
71-
Collator_ce_ptr = zend_register_internal_class( &ce );
67+
Collator_ce_ptr = register_class_Collator();
68+
Collator_ce_ptr->create_object = Collator_object_create;
7269

7370
memcpy(&Collator_handlers, &std_object_handlers,
7471
sizeof Collator_handlers);

ext/intl/converter/converter.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -966,10 +966,7 @@ static zend_object *php_converter_clone_object(zend_object *object) {
966966

967967
/* {{{ php_converter_minit */
968968
int php_converter_minit(INIT_FUNC_ARGS) {
969-
zend_class_entry ce;
970-
971-
INIT_CLASS_ENTRY(ce, "UConverter", class_UConverter_methods);
972-
php_converter_ce = zend_register_internal_class(&ce);
969+
php_converter_ce = register_class_UConverter();
973970
php_converter_ce->create_object = php_converter_create_object;
974971
memcpy(&php_converter_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
975972
php_converter_object_handlers.offset = XtOffsetOf(php_converter_object, obj);

ext/intl/converter/converter.stub.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
22

3-
/** @generate-function-entries */
3+
/**
4+
* @generate-function-entries
5+
* @generate-class-entries
6+
*/
47

58
class UConverter
69
{

ext/intl/converter/converter_arginfo.h

Lines changed: 12 additions & 1 deletion
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: e33e2614c969c59b79c6062f7a347a8e8e486d85 */
2+
* Stub hash: da9dd2dc8a994a6856e1fce33d973d979b7b67ee */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_UConverter___construct, 0, 0, 0)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, destination_encoding, IS_STRING, 1, "null")
@@ -113,3 +113,14 @@ static const zend_function_entry class_UConverter_methods[] = {
113113
ZEND_ME(UConverter, transcode, arginfo_class_UConverter_transcode, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
114114
ZEND_FE_END
115115
};
116+
117+
zend_class_entry *register_class_UConverter()
118+
{
119+
zend_class_entry ce, *class_entry;
120+
121+
INIT_CLASS_ENTRY(ce, "UConverter", class_UConverter_methods);
122+
class_entry = zend_register_internal_class_ex(&ce, NULL);
123+
124+
return class_entry;
125+
}
126+

ext/intl/dateformat/dateformat.stub.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?php
22

3-
/** @generate-function-entries */
3+
/**
4+
* @generate-function-entries
5+
* @generate-class-entries
6+
*/
47

58
class IntlDateFormatter
69
{

ext/intl/dateformat/dateformat_arginfo.h

Lines changed: 12 additions & 1 deletion
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: 62742b5f463272f43970e98900a89d513c4fb839 */
2+
* Stub hash: 3153bf65bc8776681b763284a7355537c5c9ead4 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter___construct, 0, 0, 3)
55
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 1)
@@ -125,3 +125,14 @@ static const zend_function_entry class_IntlDateFormatter_methods[] = {
125125
ZEND_ME_MAPPING(getErrorMessage, datefmt_get_error_message, arginfo_class_IntlDateFormatter_getErrorMessage, ZEND_ACC_PUBLIC)
126126
ZEND_FE_END
127127
};
128+
129+
zend_class_entry *register_class_IntlDateFormatter()
130+
{
131+
zend_class_entry ce, *class_entry;
132+
133+
INIT_CLASS_ENTRY(ce, "IntlDateFormatter", class_IntlDateFormatter_methods);
134+
class_entry = zend_register_internal_class_ex(&ce, NULL);
135+
136+
return class_entry;
137+
}
138+

0 commit comments

Comments
 (0)