This commit is contained in:
Fabien Potencier 2016-12-03 11:50:08 +01:00
parent 4a7fbdde5a
commit 5f62f01943
3 changed files with 5 additions and 15 deletions

View File

@ -61,9 +61,8 @@ class CheckCircularReferencesPass implements CompilerPassInterface
if (empty($this->checkedNodes[$id])) { if (empty($this->checkedNodes[$id])) {
// * don't check circular dependencies in lazy services. // don't check circular dependencies for lazy services
$isLazy = $node->getValue() && $node->getValue()->isLazy(); if (!$node->getValue() && $node->getValue()->isLazy()) {
if (!$isLazy) {
$searchKey = array_search($id, $this->currentPath); $searchKey = array_search($id, $this->currentPath);
$this->currentPath[] = $id; $this->currentPath[] = $id;

View File

@ -1294,9 +1294,9 @@ EOF;
$service = $this->container->getDefinition($argumentId); $service = $this->container->getDefinition($argumentId);
// if exists proxy dumper (proxy-manager) don't search references in lazy services. // 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. // as these services will be instantiated lazily and don't have direct related references.
if ($service->isLazy() && !($this->getProxyDumper() instanceof NullDumper)) { if ($service->isLazy() && !$this->getProxyDumper() instanceof NullDumper) {
continue; continue;
} }

View File

@ -82,25 +82,16 @@ class MethodCallClass
class DummyProxyDumper implements ProxyDumper class DummyProxyDumper implements ProxyDumper
{ {
/**
* {@inheritdoc}
*/
public function isProxyCandidate(Definition $definition) public function isProxyCandidate(Definition $definition)
{ {
return false; return false;
} }
/**
* {@inheritdoc}
*/
public function getProxyFactoryCode(Definition $definition, $id) public function getProxyFactoryCode(Definition $definition, $id)
{ {
return ''; return '';
} }
/**
* {@inheritdoc}
*/
public function getProxyCode(Definition $definition) public function getProxyCode(Definition $definition)
{ {
return ''; return '';