diff --git a/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php b/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php index 56f5feb644..81af931985 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php @@ -92,11 +92,11 @@ class InlineServiceDefinitionsPass extends AbstractRecursivePass implements Repe return false; } - if (!$graph->hasNode($id)) { - return true; - } - if (!$definition->isShared()) { + if (!$graph->hasNode($id)) { + return true; + } + foreach ($graph->getNode($id)->getInEdges() as $edge) { if ($edge->isWeak()) { return false; @@ -110,6 +110,10 @@ class InlineServiceDefinitionsPass extends AbstractRecursivePass implements Repe return false; } + if (!$graph->hasNode($id)) { + return true; + } + if ($this->currentId == $id) { return false; }