-
-
Notifications
You must be signed in to change notification settings - Fork 930
Open
Labels
Description
Bug report
In the following snippet https://phpstan.org/r/0c778db2-c6b4-4323-89ee-6eafea9bae53, the error is
Call to function in_array() with arguments string, array{'publishDate', 'approvedAt', 'allowedValues'} and true will always evaluate to false.
This is not clear why the evaluation is always false, it should precise lowercase-string
.
There is maybe more rule which need such precision.
This was already fixed on StrictComparisonOfDifferentTypesRule, this is the commit for inspiration
phpstan/phpstan-src@7b1ade2
Code snippet that reproduces the problem
https://phpstan.org/r/0c778db2-c6b4-4323-89ee-6eafea9bae53
Expected output
Call to function in_array() with arguments lowercase-string, array{'publishDate', 'approvedAt', 'allowedValues'} and true will always evaluate to false.
Did PHPStan help you today? Did it make you happy in any way?
It comes from https://x.com/can__vural/status/1841740920443523201, so seems like it helps a lot.
canvural