vimeo / psalm

A static analysis tool for finding errors in PHP applications
https://psalm.dev
MIT License
5.54k stars 660 forks source link

Psalm assumes `callable-string` is always lowercase #11075

Closed jnvsor closed 1 week ago

jnvsor commented 3 weeks ago

https://psalm.dev/r/aa5d92c94e

When trying to match callable-strings psalm doesn't let you lowercase them for consistency.

For example checking to see if a function is in a list of functions with in_array won't work unless the case is correct, despite PHP being case insensitive in practice.

This is not the case with strtoupper so I guess it's assuming it's already lowercase

psalm-github-bot[bot] commented 3 weeks ago

I found these snippets:

https://psalm.dev/r/aa5d92c94e ```php