diff --git a/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php b/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php index b6a898736f..11856b6cbc 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php @@ -61,9 +61,8 @@ class CheckCircularReferencesPass implements CompilerPassInterface if (empty($this->checkedNodes[$id])) { - // * don't check circular dependencies in lazy services. - $isLazy = $node->getValue() && $node->getValue()->isLazy(); - if (!$isLazy) { + // don't check circular dependencies for lazy services + if (!$node->getValue() && $node->getValue()->isLazy()) { $searchKey = array_search($id, $this->currentPath); $this->currentPath[] = $id; diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index bf5956b394..c4bfa93d2a 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -1294,9 +1294,9 @@ EOF; $service = $this->container->getDefinition($argumentId); - // if exists proxy dumper (proxy-manager) don't search references in lazy services. - // As these services will be instantiated lazily and don't have direct related references. - if ($service->isLazy() && !($this->getProxyDumper() instanceof NullDumper)) { + // if the proxy manager is enabled, disable searching for references in lazy services, + // as these services will be instantiated lazily and don't have direct related references. + if ($service->isLazy() && !$this->getProxyDumper() instanceof NullDumper) { continue; } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php index cdc89e42ab..0ecdea3fbf 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php @@ -82,25 +82,16 @@ class MethodCallClass class DummyProxyDumper implements ProxyDumper { - /** - * {@inheritdoc} - */ public function isProxyCandidate(Definition $definition) { return false; } - /** - * {@inheritdoc} - */ public function getProxyFactoryCode(Definition $definition, $id) { return ''; } - /** - * {@inheritdoc} - */ public function getProxyCode(Definition $definition) { return '';