Add ArrayChangeKeyCaseFunctionReturnTypeExtension#3549
Add ArrayChangeKeyCaseFunctionReturnTypeExtension#3549ondrejmirtes merged 7 commits intophpstan:1.12.xfrom
Conversation
615c172 to
461b22d
Compare
8f5fde7 to
61bdd79
Compare
|
This pull request has been marked as ready for review. |
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.
Calling getOffsetValueType is too expensive. You can $valueTypes = $constantArray->getValueTypes() and then access $i to get it.
|
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