Skip to content

Declare a few missing function return types #7395

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 1 commit into from

Conversation

kocsismate
Copy link
Member

@kocsismate kocsismate commented Aug 24, 2021

I found these missing return types when I regenerated the optimizer func info.

*/
function resourcebundle_get(ResourceBundle $bundle, $index, bool $fallback = true) {}
/** @param string|int $index */
function resourcebundle_get(ResourceBundle $bundle, $index, bool $fallback = true): mixed {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I saw, only a float return type is impossible, so using mixed seems to be warranted.

*/
function intltz_create_enumeration($countryOrRawOffset = null) {}
/** @param IntlTimeZone|string|int|float|null $countryOrRawOffset */
function intltz_create_enumeration($countryOrRawOffset = null): IntlIterator|false {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this one was missed. The return type seems straightforward.

@@ -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|false {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could also go back to mixed if the current specific return type is unnecessary

@kocsismate kocsismate deleted the stub-return-fixes branch August 24, 2021 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants