Skip to content

Generate methods entries from stubs for ext/spl #5458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions ext/spl/php_spl.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,28 +893,6 @@ PHP_MINFO_FUNCTION(spl)
}
/* }}} */

/* {{{ spl_functions
*/
static const zend_function_entry spl_functions[] = {
PHP_FE(spl_classes, arginfo_spl_classes)
PHP_FE(spl_autoload, arginfo_spl_autoload)
PHP_FE(spl_autoload_extensions, arginfo_spl_autoload_extensions)
PHP_FE(spl_autoload_register, arginfo_spl_autoload_register)
PHP_FE(spl_autoload_unregister, arginfo_spl_autoload_unregister)
PHP_FE(spl_autoload_functions, arginfo_spl_autoload_functions)
PHP_FE(spl_autoload_call, arginfo_spl_autoload_call)
PHP_FE(class_parents, arginfo_class_parents)
PHP_FE(class_implements, arginfo_class_implements)
PHP_FE(class_uses, arginfo_class_uses)
PHP_FE(spl_object_hash, arginfo_spl_object_hash)
PHP_FE(spl_object_id, arginfo_spl_object_id)
PHP_FE(iterator_to_array, arginfo_iterator_to_array)
PHP_FE(iterator_count, arginfo_iterator_count)
PHP_FE(iterator_apply, arginfo_iterator_apply)
PHP_FE_END
};
/* }}} */

/* {{{ PHP_MINIT_FUNCTION(spl)
*/
PHP_MINIT_FUNCTION(spl)
Expand Down Expand Up @@ -966,7 +944,7 @@ PHP_RSHUTDOWN_FUNCTION(spl) /* {{{ */
zend_module_entry spl_module_entry = {
STANDARD_MODULE_HEADER,
"SPL",
spl_functions,
ext_functions,
PHP_MINIT(spl),
NULL,
PHP_RINIT(spl),
Expand Down
5 changes: 0 additions & 5 deletions ext/spl/php_spl.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ ZEND_END_MODULE_GLOBALS(spl)
ZEND_EXTERN_MODULE_GLOBALS(spl)
#define SPL_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(spl, v)

PHP_FUNCTION(spl_classes);
PHP_FUNCTION(class_parents);
PHP_FUNCTION(class_implements);
PHP_FUNCTION(class_uses);

PHPAPI zend_string *php_spl_object_hash(zval *obj);

#endif /* PHP_SPL_H */
2 changes: 2 additions & 0 deletions ext/spl/php_spl.stub.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

/** @generate-function-entries */

function class_implements($what, bool $autoload = true): array|false {}

function class_parents($instance, bool $autoload = true): array|false {}
Expand Down
37 changes: 37 additions & 0 deletions ext/spl/php_spl_arginfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,40 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_iterator_to_array, 0, 1, IS_ARRA
ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, use_keys, _IS_BOOL, 0, "true")
ZEND_END_ARG_INFO()


ZEND_FUNCTION(class_implements);
ZEND_FUNCTION(class_parents);
ZEND_FUNCTION(class_uses);
ZEND_FUNCTION(spl_autoload);
ZEND_FUNCTION(spl_autoload_call);
ZEND_FUNCTION(spl_autoload_extensions);
ZEND_FUNCTION(spl_autoload_functions);
ZEND_FUNCTION(spl_autoload_register);
ZEND_FUNCTION(spl_autoload_unregister);
ZEND_FUNCTION(spl_classes);
ZEND_FUNCTION(spl_object_hash);
ZEND_FUNCTION(spl_object_id);
ZEND_FUNCTION(iterator_apply);
ZEND_FUNCTION(iterator_count);
ZEND_FUNCTION(iterator_to_array);


static const zend_function_entry ext_functions[] = {
ZEND_FE(class_implements, arginfo_class_implements)
ZEND_FE(class_parents, arginfo_class_parents)
ZEND_FE(class_uses, arginfo_class_uses)
ZEND_FE(spl_autoload, arginfo_spl_autoload)
ZEND_FE(spl_autoload_call, arginfo_spl_autoload_call)
ZEND_FE(spl_autoload_extensions, arginfo_spl_autoload_extensions)
ZEND_FE(spl_autoload_functions, arginfo_spl_autoload_functions)
ZEND_FE(spl_autoload_register, arginfo_spl_autoload_register)
ZEND_FE(spl_autoload_unregister, arginfo_spl_autoload_unregister)
ZEND_FE(spl_classes, arginfo_spl_classes)
ZEND_FE(spl_object_hash, arginfo_spl_object_hash)
ZEND_FE(spl_object_id, arginfo_spl_object_id)
ZEND_FE(iterator_apply, arginfo_iterator_apply)
ZEND_FE(iterator_count, arginfo_iterator_count)
ZEND_FE(iterator_to_array, arginfo_iterator_to_array)
ZEND_FE_END
};
Loading