Skip to content

Commit 62e8cc8

Browse files
committed
fix: Need to get annotations from all parent classes as well.
1 parent e32698a commit 62e8cc8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/Controller/ApiControllerBase.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,15 @@ public function autoParams() {
350350

351351
// Called class params.
352352
$class = get_class($this);
353+
$annotations = [];
353354
$reflectionClass = new \ReflectionClass($class);
354-
$annotations = $reader->getClassAnnotations($reflectionClass);
355+
while ($reflectionClass) {
356+
$annotations = array_merge(
357+
$reader->getClassAnnotations($reflectionClass),
358+
$annotations
359+
);
360+
$reflectionClass = $reflectionClass->getParentClass();
361+
}
355362

356363
// Default params.
357364
$empty_query_bag = new ParameterBag([]);

0 commit comments

Comments
 (0)