Skip to content

Invokable objects incorrectly labeled as instances of \Closure #13975

@HypeMC

Description

@HypeMC

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions