Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ff048b

Browse files
[DependencyInjection] fix inlining when non-shared services are involved
1 parent 3a2b2da commit 3ff048b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private function isInlineableDefinition(string $id, Definition $definition): boo
190190
$srcId = $edge->getSourceNode()->getId();
191191
$this->connectedIds[$srcId] = true;
192192
if ($edge->isWeak() || $edge->isLazy()) {
193-
return false;
193+
return !$this->connectedIds[$id] = true;
194194
}
195195
}
196196

@@ -212,9 +212,7 @@ private function isInlineableDefinition(string $id, Definition $definition): boo
212212

213213
$srcIds = [];
214214
$srcCount = 0;
215-
$isReferencedByConstructor = false;
216215
foreach ($this->graph->getNode($id)->getInEdges() as $edge) {
217-
$isReferencedByConstructor = $isReferencedByConstructor || $edge->isReferencedByConstructor();
218216
$srcId = $edge->getSourceNode()->getId();
219217
$this->connectedIds[$srcId] = true;
220218
if ($edge->isWeak() || $edge->isLazy()) {

0 commit comments

Comments
 (0)