Permalink
Browse files

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
  • Loading branch information...
nicolas-grekas committed Jul 13, 2017
2 parents 2ed4cfb + c4b6066 commit de5c60de0ee7c0c5d719a3bfd84d2413a3b0969f
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/Symfony/Component/DependencyInjection/Container.php
@@ -366,14 +366,14 @@ public function initialized($id)
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]);
}

0 comments on commit de5c60d

Please sign in to comment.