-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
phpstan/phpstan-src
#1019Labels
Milestone
Description
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 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