8000 bug #29393 [DI] fix edge case in InlineServiceDefinitionsPass (nicola… · symfony/symfony@21db588 · GitHub
[go: up one dir, main page]

Skip to content

Commit 21db588

Browse files
bug #29393 [DI] fix edge case in InlineServiceDefinitionsPass (nicolas-grekas)
This PR was merged into the 4.1 branch. Discussion ---------- [DI] fix edge case in InlineServiceDefinitionsPass | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Looks like this can happen - dunno how https://stackoverflow.com/questions/53558247/autowire-services-test-yaml-there-is-no-node-with-id-service-a Commits ------- 8bd2bbf [DI] fix edge case in InlineServiceDefinitionsPass
2 parents 48e34aa + 8bd2bbf commit 21db588

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ private function isInlineableDefinition($id, Definition $definition, ServiceRefe
9292
return false;
9393
}
9494

95+
if (!$graph->hasNode($id)) {
96+
return true;
97+
}
98+
9599
if (!$definition->isShared()) {
96100
foreach ($graph->getNode($id)->getInEdges() as $edge) {
97101
if ($edge->isWeak()) {
@@ -106,10 +110,6 @@ private function isInlineableDefinition($id, Definition $definition, ServiceRefe
106110
return false;
107111
}
108112

109-
if (!$graph->hasNode($id)) {
110-
return true;
111-
}
112-
113113
if ($this->currentId == $id) {
114114
return false;
115115
}

0 commit comments

Comments
 (0)
0