Bug report
Currently, PHPStan assumes every invokable object is an instance of \Closure, which is not necessarily true.
Code snippet that reproduces the problem
https://phpstan.org/r/467b09b4-6731-4c87-b228-a6f91fa0204e
Expected output
Invokable object aren't necessarily instances of \Closure, eg:
class Foo
{
public function __invoke() {}
}
Did PHPStan help you today? Did it make you happy in any way?
No response