-
Notifications
You must be signed in to change notification settings - Fork 235
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
use namespace from traits #22
Conversation
@@ -10,4 +10,29 @@ protected function getReader() | |||
{ | |||
return new AnnotationReader(); | |||
} | |||
|
|||
public function testAnnotationFromTrait() | |||
{ |
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.
shoudln't you skip the test on 5.3 ?
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.
thx, changed it.
This should also be supported for properties defined in traits |
@stof implemented propertyImports |
Please add a test with annotations on a property in a trait |
@stof test added. I'm glad you asked, found an error in the code because of the test ;) |
Looks good to me, but I don't have merge rights on this Doctrine repo |
This adds support for Annotated Methods in Traits and is a follow up and replacement for PR #20
Annotations inside of Traits can use different Namespace than the including Class, see ClassUsesTrait.php in this PR for example.
As Methods of Traits can be overwritten, the Namespace of the actual class needs to be used.
Known Issue:
In the rare case of having the Trait and the Class defined in the same File and a method from Trait is overwritten in the Class and the namespace of an annotation differs than the namespace from the trait is used instead of the correct one from the class.