Skip to content
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

Improve the return type of functions that return an indexed array of strings #997

Merged
merged 2 commits into from Feb 6, 2022

Conversation

johnbillion
Copy link
Contributor

Just some low hanging fruit. These all return an indexed array of strings.

None of them have dynamic return type extensions.

@ondrejmirtes
Copy link
Member

Can it be changed to list<string> or those aren't lists?

Please note that lists aren't fully supported by PHPStan yet and they're currently aliased to array<int, ...> but it would be a better typehint for the future.

@johnbillion
Copy link
Contributor Author

They're consecutively indexed lists, yes. I see there's only three existing uses of list in functionMap.php. I can switch these to list<string> if you prefer.

@ondrejmirtes
Copy link
Member

Yes, thank you.

@ondrejmirtes ondrejmirtes merged commit 2d7f374 into phpstan:master Feb 6, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@johnbillion johnbillion deleted the string-arrays branch February 9, 2022 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants