Skip to content

Commit

Permalink
SDK-5049: Skip duplicate plugin in if section (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
vol4onok authored Oct 16, 2023
1 parent 91022a4 commit 81835f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Builder/Visitor/AddPluginToPluginListVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ protected function addNewPluginInstance(If_ $statement): void
if ($stmt->expr->expr instanceof ArrayItem && $this->isArrayItemEqual($stmt->expr->expr)) {
continue;
}
if ($stmt->expr->expr instanceof New_ && $stmt->expr->expr->class->toString() === $this->classMetadataTransfer->getSource()) {
continue;
}

array_unshift($statement->stmts, $this->createNewAssignStatement($stmt->expr));

Expand Down

0 comments on commit 81835f9

Please sign in to comment.