Skip to content

Commit

Permalink
Fix static analysis errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Mar 24, 2023
1 parent 46e7f15 commit 7ef28f7
Show file tree
Hide file tree
Showing 4 changed files with 809 additions and 254 deletions.
9 changes: 7 additions & 2 deletions lib/Doctrine/ODM/MongoDB/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -2694,8 +2694,13 @@ public function getOwningDocument(object $document): object
throw new UnexpectedValueException('Could not determine parent association for ' . $document::class);
}

[, $document] = $parentAssociation;
$class = $this->dm->getClassMetadata($document::class);
[, $parentDocument] = $parentAssociation;
if (! $parentDocument) {
throw new UnexpectedValueException('Could not determine parent association for ' . $document::class);
}

$document = $parentDocument;
$class = $this->dm->getClassMetadata($document::class);
}

return $document;
Expand Down
Loading

0 comments on commit 7ef28f7

Please sign in to comment.