-
Notifications
You must be signed in to change notification settings - Fork 545
Add ArrayChangeKeyCaseFunctionReturnTypeExtension #3549
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
Add ArrayChangeKeyCaseFunctionReturnTypeExtension #3549
Conversation
615c172 to
461b22d
Compare
8f5fde7 to
61bdd79
Compare
|
This pull request has been marked as ready for review. |
staabm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - thanks
cdfc170 to
cdbbbb5
Compare
cdbbbb5 to
3b5b0ad
Compare
|
I updated the PR to also support |
| foreach ($constantArrays as $constantArray) { | ||
| $newConstantArrayBuilder = ConstantArrayTypeBuilder::createEmpty(); | ||
| foreach ($constantArray->getKeyTypes() as $i => $keyType) { | ||
| $valueType = $constantArray->getOffsetValueType($keyType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling getOffsetValueType is too expensive. You can $valueTypes = $constantArray->getValueTypes() and then access $i to get it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
|
Thank you. |
|
Would be nice to add a similar extension for Thanks! |
Do you have a reproducer ? Because, for me, the mb_convert_case extension is handled by
And we can see in the history that it was handled for lowercase-string and upper-case string |
|
I'm sorry, I haven't checked personally and trusted the user. PHPStan already handles it well https://phpstan.org/r/fad685d0-5331-4af2-8bb9-d0d1a0f81d00. |
|
Yes, it works fine https://phpstan.org/r/b269ff18-e0b8-42d4-9586-87edaee9fccf |
Closes phpstan/phpstan#11795
Closes phpstan/phpstan#10960
cc @staabm