-
-
Notifications
You must be signed in to change notification settings - Fork 946
Description
Feature request
I am currently providing the missing feature of class-string allowing callable objects and callable&object intersections to psalm.
Since class-string should ofc always refer to objects, I'd say that class-string<callable> can be inferred as class-string<object&callable> or class-string<callable-object> (which is also supported).
https://phpstan.org/r/5e902009-c3ce-4499-81f3-375920a80b93
I just wanted to raise the awareness that phpstan is actually not allowing class-string<callable> due to the fact that it might not be clear that we are talking about object. But I think, class-string should ofc verify the passed value to be a class-string but the resulting type should not be limited to that (esp. since an object can be passed to a callable). class-string should already provide the object information if it is not of interest of what kind of class/interface it has to be.
WDYT?