Skip to content

Commit

Permalink
Fix edge cases around merging of attachables (#1366)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerManoMann authored Dec 19, 2022
1 parent 7bd76a0 commit 8b55d61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Analysers/AttributeAnnotationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8b55d61

Please sign in to comment.