minor #23492 [DI] Check privates before resolving alias in Container::initialized (ro0NL)

This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Check privates before resolving alias in Container::initialized

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no, fixes an existing one
| Tests pass?   | yes, we dont test this behavior :(
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

Continuation of #22803, so it's consistent with logic in `has()` etc.

Commits
-------

c4b6066 [DI] Check privates before resolving alias in Container::initialized
This commit is contained in:
Nicolas Grekas 2017-07-13 10:47:41 +02:00
commit de5c60de0e

View File

@ -366,14 +366,14 @@ class Container implements ResettableContainerInterface
return false;
}
if (isset($this->aliases[$id])) {
$id = $this->aliases[$id];
}
if (isset($this->privates[$id])) {
@trigger_error(sprintf('Checking for the initialization of the "%s" private service is deprecated since Symfony 3.4 and won\'t be supported anymore in Symfony 4.0.', $id), E_USER_DEPRECATED);
}
if (isset($this->aliases[$id])) {
$id = $this->aliases[$id];
}
return isset($this->services[$id]);
}