diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index b52a321dd1..c90d3f61e2 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -155,7 +155,7 @@ class PhpDumper extends Dumper } } - (new AnalyzeServiceReferencesPass(false, !$this->getProxyDumper() instanceof NullDumper))->process($this->container); + (new AnalyzeServiceReferencesPass(false))->process($this->container); $this->circularReferences = array(); $checkedNodes = array(); foreach ($this->container->getCompiler()->getServiceReferenceGraph()->getNodes() as $id => $node) { diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_public.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_public.php index 48ae0bb250..ac10598923 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_public.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_public.php @@ -138,17 +138,11 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container */ protected function getConnectionService() { - $a = ($this->services['dispatcher'] ?? $this->getDispatcherService()); + $a = new \stdClass(); - if (isset($this->services['connection'])) { - return $this->services['connection']; - } + $this->services['connection'] = $instance = new \stdClass(($this->services['dispatcher'] ?? $this->getDispatcherService()), $a); - $b = new \stdClass(); - - $this->services['connection'] = $instance = new \stdClass($a, $b); - - $b->logger = ($this->services['logger'] ?? $this->getLoggerService()); + $a->logger = ($this->services['logger'] ?? $this->getLoggerService()); return $instance; } @@ -160,21 +154,15 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container */ protected function getConnection2Service() { - $a = ($this->services['dispatcher2'] ?? $this->getDispatcher2Service()); + $a = new \stdClass(); - if (isset($this->services['connection2'])) { - return $this->services['connection2']; - } + $this->services['connection2'] = $instance = new \stdClass(($this->services['dispatcher2'] ?? $this->getDispatcher2Service()), $a); - $b = new \stdClass(); + $b = new \stdClass($instance); - $this->services['connection2'] = $instance = new \stdClass($a, $b); + $b->handler2 = new \stdClass(($this->services['manager2'] ?? $this->getManager2Service())); - $c = new \stdClass($instance); - - $c->handler2 = new \stdClass(($this->services['manager2'] ?? $this->getManager2Service())); - - $b->logger2 = $c; + $a->logger2 = $b; return $instance; } @@ -384,12 +372,6 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container */ protected function getSubscriberService() { - $a = ($this->services['manager'] ?? $this->getManagerService()); - - if (isset($this->services['subscriber'])) { - return $this->services['subscriber']; - } - - return $this->services['subscriber'] = new \stdClass($a); + return $this->services['subscriber'] = new \stdClass(($this->services['manager'] ?? $this->getManagerService())); } }