Skip to content

Commit

Permalink
bug #30046 [DI] Fix dumping Doctrine-like service graphs (nicolas-gre…
Browse files Browse the repository at this point in the history
…kas)

This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Fix dumping Doctrine-like service graphs

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #30017 #29637 #29693
| License       | MIT
| Doc PR        | -

I'm unable to provide a reproducer for this, the required service reference graph is too crazy, but that does the job :)

Commits
-------

ed96830 [DI] Fix dumping Doctrine-like service graphs
  • Loading branch information
nicolas-grekas committed Jan 30, 2019
2 parents 83bab56 + ed96830 commit 5b1948e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Expand Up @@ -148,10 +148,6 @@ private function isInlineableDefinition($id, Definition $definition, ServiceRefe
return false;
}

if ($isReferencedByConstructor && $this->container->getDefinition($ids[0])->isLazy() && ($definition->getProperties() || $definition->getMethodCalls() || $definition->getConfigurator())) {
return false;
}

return $this->container->getDefinition($ids[0])->isShared();
}
}
Expand Up @@ -661,6 +661,7 @@ private function addService($id, Definition $definition, &$file = null)
$autowired = $definition->isAutowired() ? ' autowired' : '';

if ($definition->isLazy()) {
unset($this->circularReferences[$id]);
$lazyInitialization = '$lazyLoad = true';
} else {
$lazyInitialization = '';
Expand Down

0 comments on commit 5b1948e

Please sign in to comment.