From 8b55d616213cd0b05de84e0fabc34de74a4c6d1d Mon Sep 17 00:00:00 2001 From: Martin Rademacher Date: Mon, 19 Dec 2022 13:41:18 +1300 Subject: [PATCH] Fix edge cases around merging of attachables (#1366) --- src/Analysers/AttributeAnnotationFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Analysers/AttributeAnnotationFactory.php b/src/Analysers/AttributeAnnotationFactory.php index a8a1d843b..9367e20b0 100644 --- a/src/Analysers/AttributeAnnotationFactory.php +++ b/src/Analysers/AttributeAnnotationFactory.php @@ -96,11 +96,11 @@ public function build(\Reflector $reflector, Context $context): array // merge backwards into parents... $isParent = function (OA\AbstractAnnotation $annotation, OA\AbstractAnnotation $possibleParent): bool { // regular annotation hierarchy - $explicitParent = null !== $possibleParent::matchNested(get_class($annotation)); + $explicitParent = null !== $possibleParent::matchNested(get_class($annotation)) && !$annotation instanceof OA\Attachable; $isParentAllowed = false; // support Attachable subclasses - if ($isAttachable = $annotation instanceof OAT\Attachable) { + if ($isAttachable = $annotation instanceof OA\Attachable) { if (!$isParentAllowed = (null === $annotation->allowedParents())) { // check for allowed parents foreach ($annotation->allowedParents() as $allowedParent) {