phpstan / phpstan-strict-rules

Extra strict and opinionated rules for PHPStan
MIT License
592 stars 46 forks source link

Using named arguments with in_array causes a function.strict error #231

Closed AymDev closed 10 months ago

AymDev commented 11 months ago

I have an enum where I make a in_array() call using named arguments to set the $haystack as the last (3rd) argument, but I get the following error:

Call to function in_array() requires parameter #3 to be true.

The issue is that the $strict parameter is already set to true. Would this behaviour be considered a bug or should I stop using named arguments there ?

Here is a link to reproduce: https://phpstan.org/r/48cd75b6-c3a8-4108-904b-f2307e7e48ab

ondrejmirtes commented 10 months ago

Fixed: https://github.com/phpstan/phpstan-strict-rules/commit/5ae7a3d95286f6f2252009ab99a09010b1aaae14

github-actions[bot] commented 9 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.