Skip to content

Commit

Permalink
Fix overwrite of variable with potentially different type
Browse files Browse the repository at this point in the history
  • Loading branch information
rliebi committed Mar 14, 2024
1 parent e7844d3 commit cbcdcac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Service/PropagateChanges.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ private function addElementToIndex(
Index $index,
DocumentInterface $document,
): void {
$document = $this->documentHelper->elementToDocument($document, $element);
$index->addDocument($document);
$doc = $this->documentHelper->elementToDocument($document, $element);
$index->addDocument($doc);
}

/**
Expand All @@ -107,9 +107,9 @@ private function updateElementInIndex(
Index $index,
DocumentInterface $document,
): void {
$document = $this->documentHelper->elementToDocument($document, $element);
$doc = $this->documentHelper->elementToDocument($document, $element);
// updateDocument() allows partial updates, hence the full replace here
$index->addDocument($document);
$index->addDocument($doc);
}

/**
Expand Down

0 comments on commit cbcdcac

Please sign in to comment.