You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd expect the type of the callable's $attributes parameter in the example to be array<string, mixed>, but for some reason PHPStan thinks its mixed. When the union is removed (leaving only the callable), PHPStan reports correctly.
Did PHPStan help you today? Did it make you happy in any way?
PHPStan recently pointed me to a minor issue (when we raised its level) which led me to notice one of our tests was comprised entirely of false positives
The text was updated successfully, but these errors were encountered:
Bug report
When a function (or method) accepts a callable as part of a union, the type of the callable's parameters seems to get lost.
Code snippet that reproduces the problem
https://phpstan.org/r/7e566448-8b05-4b83-9082-f2169233c862
Expected output
I'd expect the type of the callable's
$attributes
parameter in the example to bearray<string, mixed>
, but for some reason PHPStan thinks itsmixed
. When the union is removed (leaving only the callable), PHPStan reports correctly.Did PHPStan help you today? Did it make you happy in any way?
PHPStan recently pointed me to a minor issue (when we raised its level) which led me to notice one of our tests was comprised entirely of false positives
The text was updated successfully, but these errors were encountered: