Skip to content

Commit d7f7080

Browse files
committed
Generate methods entries from stubs for ext/spl
Closes GH-5458
1 parent 77ee4e6 commit d7f7080

26 files changed

+1443
-1114
lines changed

ext/spl/php_spl.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -893,28 +893,6 @@ PHP_MINFO_FUNCTION(spl)
893893
}
894894
/* }}} */
895895

896-
/* {{{ spl_functions
897-
*/
898-
static const zend_function_entry spl_functions[] = {
899-
PHP_FE(spl_classes, arginfo_spl_classes)
900-
PHP_FE(spl_autoload, arginfo_spl_autoload)
901-
PHP_FE(spl_autoload_extensions, arginfo_spl_autoload_extensions)
902-
PHP_FE(spl_autoload_register, arginfo_spl_autoload_register)
903-
PHP_FE(spl_autoload_unregister, arginfo_spl_autoload_unregister)
904-
PHP_FE(spl_autoload_functions, arginfo_spl_autoload_functions)
905-
PHP_FE(spl_autoload_call, arginfo_spl_autoload_call)
906-
PHP_FE(class_parents, arginfo_class_parents)
907-
PHP_FE(class_implements, arginfo_class_implements)
908-
PHP_FE(class_uses, arginfo_class_uses)
909-
PHP_FE(spl_object_hash, arginfo_spl_object_hash)
910-
PHP_FE(spl_object_id, arginfo_spl_object_id)
911-
PHP_FE(iterator_to_array, arginfo_iterator_to_array)
912-
PHP_FE(iterator_count, arginfo_iterator_count)
913-
PHP_FE(iterator_apply, arginfo_iterator_apply)
914-
PHP_FE_END
915-
};
916-
/* }}} */
917-
918896
/* {{{ PHP_MINIT_FUNCTION(spl)
919897
*/
920898
PHP_MINIT_FUNCTION(spl)
@@ -966,7 +944,7 @@ PHP_RSHUTDOWN_FUNCTION(spl) /* {{{ */
966944
zend_module_entry spl_module_entry = {
967945
STANDARD_MODULE_HEADER,
968946
"SPL",
969-
spl_functions,
947+
ext_functions,
970948
PHP_MINIT(spl),
971949
NULL,
972950
PHP_RINIT(spl),

ext/spl/php_spl.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ ZEND_END_MODULE_GLOBALS(spl)
6363
ZEND_EXTERN_MODULE_GLOBALS(spl)
6464
#define SPL_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(spl, v)
6565

66-
PHP_FUNCTION(spl_classes);
67-
PHP_FUNCTION(class_parents);
68-
PHP_FUNCTION(class_implements);
69-
PHP_FUNCTION(class_uses);
70-
7166
PHPAPI zend_string *php_spl_object_hash(zval *obj);
7267

7368
#endif /* PHP_SPL_H */

ext/spl/php_spl.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
/** @generate-function-entries */
4+
35
function class_implements($what, bool $autoload = true): array|false {}
46

57
function class_parents($instance, bool $autoload = true): array|false {}

ext/spl/php_spl_arginfo.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,40 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_iterator_to_array, 0, 1, IS_ARRA
6363
ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0)
6464
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_keys, _IS_BOOL, 0, "true")
6565
ZEND_END_ARG_INFO()
66+
67+
68+
ZEND_FUNCTION(class_implements);
69+
ZEND_FUNCTION(class_parents);
70+
ZEND_FUNCTION(class_uses);
71+
ZEND_FUNCTION(spl_autoload);
72+
ZEND_FUNCTION(spl_autoload_call);
73+
ZEND_FUNCTION(spl_autoload_extensions);
74+
ZEND_FUNCTION(spl_autoload_functions);
75+
ZEND_FUNCTION(spl_autoload_register);
76+
ZEND_FUNCTION(spl_autoload_unregister);
77+
ZEND_FUNCTION(spl_classes);
78+
ZEND_FUNCTION(spl_object_hash);
79+
ZEND_FUNCTION(spl_object_id);
80+
ZEND_FUNCTION(iterator_apply);
81+
ZEND_FUNCTION(iterator_count);
82+
ZEND_FUNCTION(iterator_to_array);
83+
84+
85+
static const zend_function_entry ext_functions[] = {
86+
ZEND_FE(class_implements, arginfo_class_implements)
87+
ZEND_FE(class_parents, arginfo_class_parents)
88+
ZEND_FE(class_uses, arginfo_class_uses)
89+
ZEND_FE(spl_autoload, arginfo_spl_autoload)
90+
ZEND_FE(spl_autoload_call, arginfo_spl_autoload_call)
91+
ZEND_FE(spl_autoload_extensions, arginfo_spl_autoload_extensions)
92+
ZEND_FE(spl_autoload_functions, arginfo_spl_autoload_functions)
93+
ZEND_FE(spl_autoload_register, arginfo_spl_autoload_register)
94+
ZEND_FE(spl_autoload_unregister, arginfo_spl_autoload_unregister)
95+
ZEND_FE(spl_classes, arginfo_spl_classes)
96+
ZEND_FE(spl_object_hash, arginfo_spl_object_hash)
97+
ZEND_FE(spl_object_id, arginfo_spl_object_id)
98+
ZEND_FE(iterator_apply, arginfo_iterator_apply)
99+
ZEND_FE(iterator_count, arginfo_iterator_count)
100+
ZEND_FE(iterator_to_array, arginfo_iterator_to_array)
101+
ZEND_FE_END
102+
};

0 commit comments

Comments
 (0)