bug #25313 [DI] Fix missing unset leading to false-positive circular ref (nicolas-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Fix missing unset leading to false-positive circular ref

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

Commits
-------

17d84f6a87 [DI] Fix missing unset leading to false-positive circular ref
This commit is contained in:
Fabien Potencier 2017-12-04 09:00:00 -08:00
commit 8353d69ff1

View File

@ -298,6 +298,7 @@ class Container implements ResettableContainerInterface
} elseif (isset($this->methodMap[$id])) {
return self::IGNORE_ON_UNINITIALIZED_REFERENCE === $invalidBehavior ? null : $this->{$this->methodMap[$id]}();
} elseif (--$i && $id !== $normalizedId = $this->normalizeId($id)) {
unset($this->loading[$id]);
$id = $normalizedId;
continue;
} elseif (!$this->methodMap && !$this instanceof ContainerBuilder && __CLASS__ !== static::class && method_exists($this, $method = 'get'.strtr($id, $this->underscoreMap).'Service')) {