-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow usage of self:: accessor for constants #368
Allow usage of self:: accessor for constants #368
Conversation
f4a499b
to
c3a707b
Compare
I think |
a1bd09d
to
159936d
Compare
ex: @annotation(self::VALUE) Fixes doctrine#269
159936d
to
dc1e9ea
Compare
Seems to work in traits too. Am I missing something ? |
@bertrandseurot if you use So supporting |
@stof This will fails only if you try to directly parse a trait out of a class context : $reflectionTrait = new \ReflectionClass( RandomTrait::class );
$reader = new AnnotationReader();
$reader->getMethodAnnotations( reflectionTrait->getMethod( 'randomMethod') ); It coul'd be annoying if you wanted to do that in order to get the traits annotation cached, and use this cache later when parsing classes using this trait. But since the php Reflection API does not not allow to know if a property/method of a trait is overriden in the class, I think this strategy is currently not possible. I confirm that it works in other cases (tested in |
Because of a force-push, this PR seems stuck in a "changes requested" status. Sorry for that, it's my first PR. Should I open another or it is not a problem ? |
It's not a problem and it's not because of a force-push. You need to get another review from @stof , or to get somebody from the team to dismiss his review. |
OK, thank you ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and brings annotations in line with how PHP 8 attributes work.
ex:
@Annotation(self::VALUE)
Fixes #269