8000 bug #60826 [DependencyInjection] Fix inlining when public services ar… · symfony/symfony@8a846a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a846a9

Browse files
bug #60826 [DependencyInjection] Fix inlining when public services are involved (nicolas-grekas)
This PR was merged into the 6.4 branch. Discussion ---------- [DependencyInjection] Fix inlining when public services are involved | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #54294, fix #58087 | License | MIT I can't come up with a simple reproducer that'd fit in a test case 😞 Commits ------- b982f6e [DependencyInjection] Fix inlining when public services are involved
2 parents 519c9e0 + b982f6e commit 8a846a9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ public function process(ContainerBuilder $container)
7373
if (!$this->graph->hasNode($id)) {
7474
continue;
7575
}
76+
if ($definition->isPublic()) {
77+
$this->connectedIds[$id] = true;
78+
}
7679
foreach ($this->graph->getNode($id)->getOutEdges() as $edge) {
7780
if (isset($notInlinedIds[$edge->getSourceNode()->getId()])) {
7881
$this->currentId = $id;
@@ -189,17 +192,13 @@ private function isInlineableDefinition(string $id, Definition $definition): boo
189192
return true;
190193
}
191194

192-
if ($definition->isPublic()) {
195+
if ($definition->isPublic()
196+
|| $this->currentId === $id
197+
|| !$this->graph->hasNode($id)
198+
) {
193199
return false;
194200
}
195201

196-
if (!$this->graph->hasNode($id)) {
197-
return true;
198-
}
199-
200-
if ($this->currentId === $id) {
201-
return false;
202-
}
203202
$this->connectedIds[$id] = true;
204203

205204
$srcIds = [];

0 commit comments

Comments
 (0)
0