Skip to content

Commit c58a9f2

Browse files
committed
Declare a few missing function return types
Closes GH-7395
1 parent ffcf5ba commit c58a9f2

File tree

4 files changed

+10
-17
lines changed

4 files changed

+10
-17
lines changed

ext/intl/php_intl.stub.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,8 @@ function normalizer_get_raw_decomposition(string $string, int $form = Normalizer
349349

350350
function resourcebundle_create(?string $locale, ?string $bundle, bool $fallback = true): ?ResourceBundle {}
351351

352-
/**
353-
* @param string|int $index
354-
* @return mixed
355-
*/
356-
function resourcebundle_get(ResourceBundle $bundle, $index, bool $fallback = true) {}
352+
/** @param string|int $index */
353+
function resourcebundle_get(ResourceBundle $bundle, $index, bool $fallback = true): mixed {}
357354

358355
function resourcebundle_count(ResourceBundle $bundle): int {}
359356

@@ -369,11 +366,8 @@ function intltz_count_equivalent_ids(string $timezoneId): int|false {}
369366

370367
function intltz_create_default(): IntlTimeZone {}
371368

372-
/**
373-
* @param IntlTimeZone|string|int|float|null $countryOrRawOffset
374-
* @return IntlIterator|false
375-
*/
376-
function intltz_create_enumeration($countryOrRawOffset = null) {}
369+
/** @param IntlTimeZone|string|int|float|null $countryOrRawOffset */
370+
function intltz_create_enumeration($countryOrRawOffset = null): IntlIterator|false {}
377371

378372
function intltz_create_time_zone(string $timezoneId): ?IntlTimeZone {}
379373

ext/intl/php_intl_arginfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 9d40cc3b008e968f4ae28e147209095c698334a5 */
2+
* Stub hash: 55a689451b2c1ff5900c47111d350168f3ddec00 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1)
55
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
630630
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fallback, _IS_BOOL, 0, "true")
631631
ZEND_END_ARG_INFO()
632632

633-
ZEND_BEGIN_ARG_INFO_EX(arginfo_resourcebundle_get, 0, 0, 2)
633+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_resourcebundle_get, 0, 2, IS_MIXED, 0)
634634
ZEND_ARG_OBJ_INFO(0, bundle, ResourceBundle, 0)
635635
ZEND_ARG_INFO(0, index)
636636
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fallback, _IS_BOOL, 0, "true")
@@ -657,7 +657,7 @@ ZEND_END_ARG_INFO()
657657
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intltz_create_default, 0, 0, IntlTimeZone, 0)
658658
ZEND_END_ARG_INFO()
659659

660-
ZEND_BEGIN_ARG_INFO_EX(arginfo_intltz_create_enumeration, 0, 0, 0)
660+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_intltz_create_enumeration, 0, 0, IntlIterator, MAY_BE_FALSE)
661661
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, countryOrRawOffset, "null")
662662
ZEND_END_ARG_INFO()
663663

ext/standard/basic_functions.stub.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,8 +1423,7 @@ function uniqid(string $prefix = "", bool $more_entropy = false): string {}
14231423

14241424
/* url.c */
14251425

1426-
/** @return mixed */
1427-
function parse_url(string $url, int $component = -1) {}
1426+
function parse_url(string $url, int $component = -1): int|string|array|null|false {}
14281427

14291428
function urlencode(string $string): string {}
14301429

ext/standard/basic_functions_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 8a11321dffd77850616db42a5c77fc33c30b361f */
2+
* Stub hash: 963bd7624ec5f981ac9074eef94f9da740aa5108 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
55
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)
20952095
ZEND_END_ARG_INFO()
20962096
#endif
20972097

2098-
ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_url, 0, 0, 1)
2098+
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)
20992099
ZEND_ARG_TYPE_INFO(0, url, IS_STRING, 0)
21002100
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, component, IS_LONG, 0, "-1")
21012101
ZEND_END_ARG_INFO()

0 commit comments

Comments
 (0)