Skip to content

Update ext/spl parameter names #6284

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 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Zend/zend_interfaces.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ interface Serializable
public function serialize();

/** @return void */
public function unserialize(string $serialized);
public function unserialize(string $data);
}

interface Countable
Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_interfaces_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 1aa9ef81a738328a334176d37683646b60b2f6fa */
* Stub hash: 29a5ed0b859b0732074c81cf9d26047a6eb9059a */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IteratorAggregate_getIterator, 0, 0, 0)
ZEND_END_ARG_INFO()
Expand Down Expand Up @@ -30,7 +30,7 @@ ZEND_END_ARG_INFO()
#define arginfo_class_Serializable_serialize arginfo_class_IteratorAggregate_getIterator

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Serializable_unserialize, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
ZEND_END_ARG_INFO()

#define arginfo_class_Countable_count arginfo_class_IteratorAggregate_getIterator
Expand Down
2 changes: 1 addition & 1 deletion ext/hash/hash.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ private function __construct() {}

public function __serialize(): array {}

public function __unserialize(array $serialized): void {}
public function __unserialize(array $data): void {}
}
4 changes: 2 additions & 2 deletions ext/hash/hash_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 5298231334ab85edd67ae46c33b7e6cffb2ecc53 */
* Stub hash: 9352e0ac98e2ac53dc15d5024f9ef0c8092c4e9c */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
Expand Down Expand Up @@ -121,7 +121,7 @@ ZEND_END_ARG_INFO()
#define arginfo_class_HashContext___serialize arginfo_hash_algos

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_HashContext___unserialize, 0, 1, IS_VOID, 0)
ZEND_ARG_TYPE_INFO(0, serialized, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, data, IS_ARRAY, 0)
ZEND_END_ARG_INFO()


Expand Down
2 changes: 1 addition & 1 deletion ext/phar/tests/phar_oo_006.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ unlink(__DIR__ . '/files/phar_oo_006.phar.php');
__halt_compiler();
?>
--EXPECTF--
SplFileInfo::setFileClass(): Argument #1 ($class_name) must be a class name derived from SplFileObject, SplFileInfo given
SplFileInfo::setFileClass(): Argument #1 ($class) must be a class name derived from SplFileObject, SplFileInfo given
MyFile::__construct(phar://%s/a.php)
a.php
MyFile::__construct(phar://%s/b/c.php)
Expand Down
8 changes: 4 additions & 4 deletions ext/spl/php_spl.stub.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ function spl_autoload_extensions(?string $file_extensions = null): string {}

function spl_autoload_functions(): array {}

function spl_autoload_register(?callable $autoload_function = null, bool $throw = true, bool $prepend = false): bool {}
function spl_autoload_register(?callable $callback = null, bool $throw = true, bool $prepend = false): bool {}

function spl_autoload_unregister(callable $autoload_function): bool {}
function spl_autoload_unregister(callable $callback): bool {}

function spl_classes(): array {}

function spl_object_hash(object $object): string {}

function spl_object_id(object $object): int {}

function iterator_apply(Traversable $iterator, callable $function, ?array $args = null): int {}
function iterator_apply(Traversable $iterator, callable $callback, ?array $args = null): int {}

function iterator_count(Traversable $iterator): int {}

function iterator_to_array(Traversable $iterator, bool $use_keys = true): array {}
function iterator_to_array(Traversable $iterator, bool $preserve_keys = true): array {}
10 changes: 5 additions & 5 deletions ext/spl/php_spl_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 31d99979ea43e3d0d2592495977465976ca67760 */
* Stub hash: 920cc4fca334f59316fc4276277958c9738afb3e */

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_implements, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_INFO(0, object_or_class)
Expand Down Expand Up @@ -27,13 +27,13 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload_functions, 0, 0, IS
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload_register, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, autoload_function, IS_CALLABLE, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, callback, IS_CALLABLE, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, throw, _IS_BOOL, 0, "true")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, prepend, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_spl_autoload_unregister, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, autoload_function, IS_CALLABLE, 0)
ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
ZEND_END_ARG_INFO()

#define arginfo_spl_classes arginfo_spl_autoload_functions
Expand All @@ -48,7 +48,7 @@ ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_iterator_apply, 0, 2, IS_LONG, 0)
ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0)
ZEND_ARG_TYPE_INFO(0, function, IS_CALLABLE, 0)
ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, args, IS_ARRAY, 1, "null")
ZEND_END_ARG_INFO()

Expand All @@ -58,7 +58,7 @@ ZEND_END_ARG_INFO()

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_WITH_DEFAULT_VALUE(0, use_keys, _IS_BOOL, 0, "true")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, preserve_keys, _IS_BOOL, 0, "true")
ZEND_END_ARG_INFO()


Expand Down
58 changes: 29 additions & 29 deletions ext/spl/spl_array.stub.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@

class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Countable
{
public function __construct(array|object $input = [], int $flags = 0, string $iterator_class = ArrayIterator::class) {}
public function __construct(array|object $array = [], int $flags = 0, string $iteratorClass = ArrayIterator::class) {}

/**
* @param string|int $index
* @param string|int $key
* @return bool
*/
public function offsetExists($index) {}
public function offsetExists($key) {}

/**
* @param string|int $index
* @param string|int $key
* @return mixed
*/
public function offsetGet($index) {}
public function offsetGet($key) {}

/**
* @param string|int $index
* @param string|int $key
* @return void
*/
public function offsetSet($index, mixed $value) {}
public function offsetSet($key, mixed $value) {}

/**
* @param string|int $index
* @param string|int $key
* @return void
*/
public function offsetUnset($index) {}
public function offsetUnset($key) {}

/** @return void */
public function append(mixed $value) {}
Expand All @@ -46,16 +46,16 @@ public function getFlags() {}
public function setFlags(int $flags) {}

/** @return bool */
public function asort(int $sort_flags = SORT_REGULAR) {}
public function asort(int $flags = SORT_REGULAR) {}

/** @return bool */
public function ksort(int $sort_flags = SORT_REGULAR) {}
public function ksort(int $flags = SORT_REGULAR) {}

/** @return bool */
public function uasort(callable $cmp_function) {}
public function uasort(callable $callback) {}

/** @return bool */
public function uksort(callable $cmp_function) {}
public function uksort(callable $callback) {}

/** @return bool */
public function natsort() {}
Expand All @@ -64,7 +64,7 @@ public function natsort() {}
public function natcasesort() {}

/** @return void */
public function unserialize(string $serialized) {}
public function unserialize(string $data) {}

/** @return string */
public function serialize() {}
Expand All @@ -79,7 +79,7 @@ public function __unserialize(array $data) {}
public function getIterator() {}

/** @return array|null */
public function exchangeArray(array|object $input) {}
public function exchangeArray(array|object $array) {}

/** @return void */
public function setIteratorClass(string $iteratorClass) {}
Expand All @@ -96,32 +96,32 @@ class ArrayIterator implements SeekableIterator, ArrayAccess, Serializable, Coun
public function __construct(array|object $array = [], int $flags = 0) {}

/**
* @param string|int $index
* @param string|int $key
* @return bool
* @implementation-alias ArrayObject::offsetExists
*/
public function offsetExists($index) {}
public function offsetExists($key) {}

/**
* @param string|int $index
* @param string|int $key
* @return mixed
* @implementation-alias ArrayObject::offsetGet
*/
public function offsetGet($index) {}
public function offsetGet($key) {}

/**
* @param string|int $index
* @param string|int $key
* @return void
* @implementation-alias ArrayObject::offsetSet
*/
public function offsetSet($index, mixed $value) {}
public function offsetSet($key, mixed $value) {}

/**
* @param string|int $index
* @param string|int $key
* @return void
* @implementation-alias ArrayObject::offsetUnset
*/
public function offsetUnset($index) {}
public function offsetUnset($key) {}

/**
* @return void
Expand Down Expand Up @@ -157,25 +157,25 @@ public function setFlags(int $flags) {}
* @return bool
* @implementation-alias ArrayObject::asort
*/
public function asort(int $sort_flags = SORT_REGULAR) {}
public function asort(int $flags = SORT_REGULAR) {}

/**
* @return bool
* @implementation-alias ArrayObject::ksort
*/
public function ksort(int $sort_flags = SORT_REGULAR) {}
public function ksort(int $flags = SORT_REGULAR) {}

/**
* @return bool
* @implementation-alias ArrayObject::uasort
*/
public function uasort(callable $cmp_function) {}
public function uasort(callable $callback) {}

/**
* @return bool
* @implementation-alias ArrayObject::uksort
*/
public function uksort(callable $cmp_function) {}
public function uksort(callable $callback) {}

/**
* @return bool
Expand All @@ -193,7 +193,7 @@ public function natcasesort() {}
* @return void
* @implementation-alias ArrayObject::unserialize
*/
public function unserialize(string $serialized) {}
public function unserialize(string $data) {}

/**
* @return string
Expand Down Expand Up @@ -229,7 +229,7 @@ public function next() {}
public function valid() {}

/** @return void */
public function seek(int $position) {}
public function seek(int $offset) {}

/**
* @return array
Expand Down
20 changes: 10 additions & 10 deletions ext/spl/spl_array_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 1b93d102c6dfa12f65a95a50bbc78c03802e261c */
* Stub hash: da85db1e5e985ddbefaf38598133e3cba46475f2 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject___construct, 0, 0, 0)
ZEND_ARG_TYPE_MASK(0, input, MAY_BE_ARRAY|MAY_BE_OBJECT, "[]")
ZEND_ARG_TYPE_MASK(0, array, MAY_BE_ARRAY|MAY_BE_OBJECT, "[]")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, iterator_class, IS_STRING, 0, "ArrayIterator::class")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, iteratorClass, IS_STRING, 0, "ArrayIterator::class")
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_offsetExists, 0, 0, 1)
ZEND_ARG_INFO(0, index)
ZEND_ARG_INFO(0, key)
ZEND_END_ARG_INFO()

#define arginfo_class_ArrayObject_offsetGet arginfo_class_ArrayObject_offsetExists

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_offsetSet, 0, 0, 2)
ZEND_ARG_INFO(0, index)
ZEND_ARG_INFO(0, key)
ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_END_ARG_INFO()

Expand All @@ -36,13 +36,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_setFlags, 0, 0, 1)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_asort, 0, 0, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sort_flags, IS_LONG, 0, "SORT_REGULAR")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "SORT_REGULAR")
ZEND_END_ARG_INFO()

#define arginfo_class_ArrayObject_ksort arginfo_class_ArrayObject_asort

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_uasort, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, cmp_function, IS_CALLABLE, 0)
ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
ZEND_END_ARG_INFO()

#define arginfo_class_ArrayObject_uksort arginfo_class_ArrayObject_uasort
Expand All @@ -52,7 +52,7 @@ ZEND_END_ARG_INFO()
#define arginfo_class_ArrayObject_natcasesort arginfo_class_ArrayObject_getArrayCopy

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_unserialize, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, serialized, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
ZEND_END_ARG_INFO()

#define arginfo_class_ArrayObject_serialize arginfo_class_ArrayObject_getArrayCopy
Expand All @@ -66,7 +66,7 @@ ZEND_END_ARG_INFO()
#define arginfo_class_ArrayObject_getIterator arginfo_class_ArrayObject_getArrayCopy

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_exchangeArray, 0, 0, 1)
ZEND_ARG_TYPE_MASK(0, input, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL)
ZEND_ARG_TYPE_MASK(0, array, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayObject_setIteratorClass, 0, 0, 1)
Expand Down Expand Up @@ -131,7 +131,7 @@ ZEND_END_ARG_INFO()
#define arginfo_class_ArrayIterator_valid arginfo_class_ArrayObject_getArrayCopy

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ArrayIterator_seek, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, position, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0)
ZEND_END_ARG_INFO()

#define arginfo_class_ArrayIterator___debugInfo arginfo_class_ArrayObject_getArrayCopy
Expand Down
Loading