10000 minor #23492 [DI] Check privates before resolving alias in Container:… · symfony/symfony@de5c60d · GitHub
[go: up one dir, main page]

Skip to content

Commit de5c60d

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
2 parents 2ed4cfb + c4b6066 commit de5c60d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/DependencyInjection/Container.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,14 @@ public function initialized($id)
366366
return false;
367367
}
368368

369-
if (isset($this->aliases[$id])) {
370-
$id = $this->aliases[$id];
371-
}
372-
373369
if (isset($this->privates[$id])) {
374370
@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);
375371
}
376372

373+
if (isset($this->aliases[$id])) {
374+
$id = $this->aliases[$id];
375+
}
376+
377377
return isset($this->services[$id]);
378378
}
379379

0 commit comments

Comments
 (0)
0