phpstan-src icon indicating copy to clipboard operation
phpstan-src copied to clipboard

Add ArrayChangeKeyCaseFunctionReturnTypeExtension

Open VincentLanglet opened this issue 1 year ago • 1 comments

Closes https://github.com/phpstan/phpstan/issues/11795 Closes https://github.com/phpstan/phpstan/issues/10960

cc @staabm

VincentLanglet avatar Oct 07 '24 19:10 VincentLanglet

This pull request has been marked as ready for review.

phpstan-bot avatar Oct 07 '24 21:10 phpstan-bot

I updated the PR to also support uppercase-string @ondrejmirtes

VincentLanglet avatar Nov 24 '24 22:11 VincentLanglet

Thank you.

ondrejmirtes avatar Jan 16 '25 14:01 ondrejmirtes

Would be nice to add a similar extension for mb_convert_case, would you look into it? Context: https://github.com/phpstan/phpstan/discussions/12452

Thanks!

ondrejmirtes avatar Jan 22 '25 12:01 ondrejmirtes

Would be nice to add a similar extension for mb_convert_case, would you look into it? Context: phpstan/phpstan#12452

Thanks!

Do you have a reproducer ?

Because, for me, the mb_convert_case extension is handled by https://github.com/phpstan/phpstan-src/blob/e2b5a60fa52460ba3addd519b07e2244809878ee/src/Type/Php/StrCaseFunctionsReturnTypeExtension.php#L45

And we can see in the history that it was handled for lowercase-string and upper-case string https://github.com/phpstan/phpstan-src/commits/e2b5a60fa52460ba3addd519b07e2244809878ee/src/Type/Php/StrCaseFunctionsReturnTypeExtension.php

VincentLanglet avatar Jan 22 '25 12:01 VincentLanglet

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.

ondrejmirtes avatar Jan 22 '25 12:01 ondrejmirtes

Yes, it works fine https://phpstan.org/r/b269ff18-e0b8-42d4-9586-87edaee9fccf

VincentLanglet avatar Jan 22 '25 13:01 VincentLanglet