Skip to content

Generic method in trait: Parameter expects class-string<T of object>|T of object, string given #2837

@simPod

Description

@simPod

When implementing generic method in trait, phpstan seems to ignore method's docs and does not consider passed string as class-string<T> even though the docs says so

https://phpstan.org/r/b20eb9d9-74ad-4355-b109-d2540196c9f3

When not using the trait for it, it works fine https://phpstan.org/r/a65993a4-cd25-4c23-b23d-eea5bd58aeed

Seems similar to #2808

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions