Change return type of hash_update() to true (#13652)

It was already the case that this could only return true, update the
stubs to reflect that.

Closes GH-13614.
This commit is contained in:
Niels Dossche 2024-03-09 20:02:50 +01:00 committed by GitHub
parent 14b6c981c3
commit a47849deaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 3 deletions

3
NEWS
View File

@ -54,6 +54,9 @@ PHP NEWS
. bind_textdomain_codeset now throws an exception on empty domain.
(David Carlier)
- Hash:
. Changed return type of hash_update() to true. (nielsdos)
- IMAP:
. Moved to PECL. (Derick Rethans)

View File

@ -325,6 +325,10 @@ PHP 8.4 UPGRADE NOTES
- Gettext:
. bind_textdomain_codeset now throws an exception if the domain's argument is empty.
- Hash:
. Changed the return type of hash_update() to true. It was already the case that only
true could be returned, but the stub was not updated yet.
- Intl:
. IntlDateFormatter::__construct() throws a ValueError if the locale is invalid.
. NumberFormatter::__construct() throws a ValueError if the locale is invalid.

View File

@ -29,7 +29,7 @@ function hash_hmac_file(string $algo, string $filename, #[\SensitiveParameter] s
*/
function hash_init(string $algo, int $flags = 0, #[\SensitiveParameter] string $key = "", array $options = []): HashContext {}
function hash_update(HashContext $context, string $data): bool {}
function hash_update(HashContext $context, string $data): true {}
/** @param resource $stream */
function hash_update_stream(HashContext $context, $stream, int $length = -1): int {}

View File

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: f4531ebc6817042a2729c3dd1502631656c29f05 */
* Stub hash: 9c0f01839a287d394b78b0dfd37b278a59d1b366 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash, 0, 2, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
@ -36,7 +36,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_hash_init, 0, 1, HashContext, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_update, 0, 2, _IS_BOOL, 0)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_update, 0, 2, IS_TRUE, 0)
ZEND_ARG_OBJ_INFO(0, context, HashContext, 0)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
ZEND_END_ARG_INFO()