We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It seems that the class inheritance is ignored for annotations.
I need to do that to get the inheritance. Am I doing something wrong?
(It works with the patch below. I'd be happy to contribute a proper PR.)
From 0111785f8fc91e66195916072f1fcff05cbfa95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20M=C3=A4nnchen?= <jonatan.maennchen@ibrows.ch> Date: Thu, 19 May 2016 11:47:25 +0000 Subject: [PATCH] Annotation Class Inheritance --- src/Hateoas/Configuration/Metadata/Driver/AnnotationDriver.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Hateoas/Configuration/Metadata/Driver/AnnotationDriver.php b/src/Hateoas/Configuration/Metadata/Driver/AnnotationDriver.php index 6364c55..41cc53d 100644 --- a/src/Hateoas/Configuration/Metadata/Driver/AnnotationDriver.php +++ b/src/Hateoas/Configuration/Metadata/Driver/AnnotationDriver.php @@ -37,6 +37,12 @@ class AnnotationDriver implements DriverInterface { $annotations = $this->reader->getClassAnnotations($class); + $parent = $class->getParentClass(); + while($parent instanceof \ReflectionClass) { + $annotations = array_merge($annotations, $this->reader->getClassAnnotations($parent)); + $parent = $parent->getParentClass(); + } + if (0 === count($annotations)) { return null; } -- 2.2.1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It seems that the class inheritance is ignored for annotations.
I need to do that to get the inheritance. Am I doing something wrong?
(It works with the patch below. I'd be happy to contribute a proper PR.)
The text was updated successfully, but these errors were encountered: