From fe80f51a5dc45d4276458e5c12d883f69ea3257f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Tue, 24 Aug 2021 08:24:42 +0200 Subject: [PATCH] Declare a few missing function return types --- ext/intl/php_intl.stub.php | 14 ++++---------- ext/intl/php_intl_arginfo.h | 6 +++--- ext/standard/basic_functions.stub.php | 3 +-- ext/standard/basic_functions_arginfo.h | 4 ++-- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/ext/intl/php_intl.stub.php b/ext/intl/php_intl.stub.php index 621235231d400..e876db6f3464a 100644 --- a/ext/intl/php_intl.stub.php +++ b/ext/intl/php_intl.stub.php @@ -349,11 +349,8 @@ function normalizer_get_raw_decomposition(string $string, int $form = Normalizer function resourcebundle_create(?string $locale, ?string $bundle, bool $fallback = true): ?ResourceBundle {} -/** - * @param string|int $index - * @return mixed - */ -function resourcebundle_get(ResourceBundle $bundle, $index, bool $fallback = true) {} +/** @param string|int $index */ +function resourcebundle_get(ResourceBundle $bundle, $index, bool $fallback = true): mixed {} function resourcebundle_count(ResourceBundle $bundle): int {} @@ -369,11 +366,8 @@ function intltz_count_equivalent_ids(string $timezoneId): int|false {} function intltz_create_default(): IntlTimeZone {} -/** - * @param IntlTimeZone|string|int|float|null $countryOrRawOffset - * @return IntlIterator|false - */ -function intltz_create_enumeration($countryOrRawOffset = null) {} +/** @param IntlTimeZone|string|int|float|null $countryOrRawOffset */ +function intltz_create_enumeration($countryOrRawOffset = null): IntlIterator|false {} function intltz_create_time_zone(string $timezoneId): ?IntlTimeZone {} diff --git a/ext/intl/php_intl_arginfo.h b/ext/intl/php_intl_arginfo.h index 8201307363fb4..3d2884a86384f 100644 --- a/ext/intl/php_intl_arginfo.h +++ b/ext/intl/php_intl_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 9d40cc3b008e968f4ae28e147209095c698334a5 */ + * Stub hash: 55a689451b2c1ff5900c47111d350168f3ddec00 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timezone, "null") @@ -630,7 +630,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_resourcebundle_create, 0, 2, Reso ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fallback, _IS_BOOL, 0, "true") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_resourcebundle_get, 0, 0, 2) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_resourcebundle_get, 0, 2, IS_MIXED, 0) ZEND_ARG_OBJ_INFO(0, bundle, ResourceBundle, 0) ZEND_ARG_INFO(0, index) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fallback, _IS_BOOL, 0, "true") @@ -657,7 +657,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intltz_create_default, 0, 0, IntlTimeZone, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_intltz_create_enumeration, 0, 0, 0) +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_intltz_create_enumeration, 0, 0, IntlIterator, MAY_BE_FALSE) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, countryOrRawOffset, "null") ZEND_END_ARG_INFO() diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 431310d959284..243e7798b2a92 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -1423,8 +1423,7 @@ function uniqid(string $prefix = "", bool $more_entropy = false): string {} /* url.c */ -/** @return mixed */ -function parse_url(string $url, int $component = -1) {} +function parse_url(string $url, int $component = -1): int|string|array|null|false {} function urlencode(string $string): string {} diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index e2d5c38f60d84..77f3662d2c6ff 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 8a11321dffd77850616db42a5c77fc33c30b361f */ + * Stub hash: 963bd7624ec5f981ac9074eef94f9da740aa5108 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) @@ -2095,7 +2095,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_uniqid, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() #endif -ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_url, 0, 0, 1) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_parse_url, 0, 1, MAY_BE_LONG|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_NULL|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, url, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, component, IS_LONG, 0, "-1") ZEND_END_ARG_INFO()