-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Convert spl functions arginfo to php stubs #4733
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
+101
−71
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
function iterator_to_array(Traversable $iterator, bool $use_keys = true): array {} | ||
|
||
function iterator_count(Traversable $iterator): int {} | ||
|
||
function iterator_apply(Traversable $iterator, callable $function, ?array $args = null): ?int {} | ||
|
||
function class_parents(object|string $instance, bool $autoload = true): array|false {} | ||
|
||
function class_implements(object|string $what, bool $autoload = true): array|false {} | ||
|
||
function class_uses(object|string $what, bool $autoload = true): array|false {} | ||
|
||
function spl_classes(): array {} | ||
|
||
function spl_autoload_functions(): array|false {} | ||
|
||
function spl_autoload(string $class_name, string $file_extensions = UNKNOWN): void {} | ||
|
||
function spl_autoload_extensions(string $file_extensions = UNKNOWN): string {} | ||
|
||
function spl_autoload_call(string $class_name): void {} | ||
|
||
/** | ||
* @param callable $autoload_function | ||
*/ | ||
function spl_autoload_register($autoload_function = UNKNOWN, bool $throw = true, bool $prepend = false): bool {} | ||
|
||
function spl_autoload_unregister($autoload_function): bool {} | ||
|
||
function spl_object_hash(object $obj): string {} | ||
|
||
function spl_object_id(object $obj): int {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* This is a generated file, edit the .stub.php file instead. */ | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_iterator_to_array, 0, 1, IS_ARRAY, 0) | ||
ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0) | ||
ZEND_ARG_TYPE_INFO(0, use_keys, _IS_BOOL, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_iterator_count, 0, 1, IS_LONG, 0) | ||
ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_iterator_apply, 0, 2, IS_LONG, 1) | ||
ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0) | ||
ZEND_ARG_TYPE_INFO(0, function, IS_CALLABLE, 0) | ||
ZEND_ARG_TYPE_INFO(0, args, IS_ARRAY, 1) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_parents, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) | ||
ZEND_ARG_TYPE_MASK(0, instance, MAY_BE_OBJECT|MAY_BE_STRING) | ||
ZEND_ARG_TYPE_INFO(0, autoload, _IS_BOOL, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_implements, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) | ||
ZEND_ARG_TYPE_MASK(0, what, MAY_BE_OBJECT|MAY_BE_STRING) | ||
ZEND_ARG_TYPE_INFO(0, autoload, _IS_BOOL, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
#define arginfo_class_uses arginfo_class_implements | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_classes, 0, 0, IS_ARRAY, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_spl_autoload_functions, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload, 0, 1, IS_VOID, 0) | ||
ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0) | ||
ZEND_ARG_TYPE_INFO(0, file_extensions, IS_STRING, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload_extensions, 0, 0, IS_STRING, 0) | ||
ZEND_ARG_TYPE_INFO(0, file_extensions, IS_STRING, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload_call, 0, 1, IS_VOID, 0) | ||
ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload_register, 0, 0, _IS_BOOL, 0) | ||
ZEND_ARG_INFO(0, autoload_function) | ||
ZEND_ARG_TYPE_INFO(0, throw, _IS_BOOL, 0) | ||
ZEND_ARG_TYPE_INFO(0, prepend, _IS_BOOL, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload_unregister, 0, 1, _IS_BOOL, 0) | ||
ZEND_ARG_INFO(0, autoload_function) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_object_hash, 0, 1, IS_STRING, 0) | ||
ZEND_ARG_TYPE_INFO(0, obj, IS_OBJECT, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_object_id, 0, 1, IS_LONG, 0) | ||
ZEND_ARG_TYPE_INFO(0, obj, IS_OBJECT, 0) | ||
ZEND_END_ARG_INFO() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
object|string
union is not yet supported based on this: 292a1ae (see the description as well)