Skip to content

support for class-string-map<T of Foo> #281

@jaapio

Description

@jaapio

I was investigating the option to add support for class-string-map<T of Foo> and found #246, and also phpstan/phpstan#9521. According to @ondrejmirtes in #246 this syntax should already be supported by this library. But is it not.

I'm wondering if we should introduce the syntax, and how this would look like. I can help with the implementation in the parser. But not without an agreement on how this would work on the GenericType.

I would suggest to add a $bound type on the GenericType which is equal to the behavior on @template

This is needed to the mentioned change in phpstan and phpDocumentor/TypeResolver#266. Support in the parser would at least prevent a crash in the parser.

Thanks for this library! 🎉

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions