Skip to content

Support for generics in ReflectionAttribute #5511

@vhenzl

Description

@vhenzl

ReflectionAttribute should be generic, so that \ReflectionClass::getAttributes() and \ReflectionAttribute::newInstance() have information about the attribute type:

https://phpstan.org/r/83d2e1b0-6e61-42b2-bfc3-17f329c223ee

\ReflectionClass::getAttributes(string $name = null, int $flags = 0) will need a dynamic return type extension reflecting $name parameter. The second parameter changes method's behaviour but doesn't have affect on the return type.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions