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])) {
// * 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;

View File

@ -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;
}

View File

@ -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 '';