Skip to content

Conversation

@ollieread
Copy link
Contributor

This is my first attempt at introducing the interface ReflectorWithAttributes which is implemented by the following classes:

  • ReflectionFunctionAbstract
  • ReflectionParameter
  • ReflectionClass
  • ReflectionProperty

The getAttributes() method present all of the above has been moved to this new interface, and the following methods have been added:

  • getFirstAttribute(?string $name = null, int $flags = 0): ?ReflectionAttribute
  • hasAttribute(?string $name = null, int $flags = 0): bool

I've tried to work with what is currently there, rather than replacing the current approach to attributes, but I can't speak for efficiency and such, so would appreciate any feedback.

This PR is an implementation of #8489, which was mentioned on the mailing list with little to no feedback.

@ollieread
Copy link
Contributor Author

I have absolutely no idea why the tests aren't passing on 3 of the 5 platforms, but I'll continue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant