-
-
Notifications
You must be signed in to change notification settings - Fork 934
Open
phpstan/phpstan-src
#4226Labels
Milestone
Description
Bug report
PHPStan seems to ignore param default values when analysing conditional types that are part of @phpstan-assert annotations.
The example has just a single param in the conditional type expression but more complex (nested) expressions may use multiple params, all of which would be affected.
The problem also affects both positional and named parameters.
Code snippet that reproduces the problem
https://phpstan.org/r/03bf067f-d92e-479b-a8bf-f1ee9d8bcc03
Expected output
The param type(s) should be inferred correctly even if the param(s) is/are not specified explicitly.
Conditional types in @phpstan-return do not seem to be affected:
https://phpstan.org/r/b7c3a988-f93f-4cbb-a899-abdf8fc82782
Did PHPStan help you today? Did it make you happy in any way?
No response