bug #34728 [DI] fix overriding existing services with aliases for singly-implemented interfaces (nicolas-grekas)
This PR was merged into the 4.4 branch.
Discussion
----------
[DI] fix overriding existing services with aliases for singly-implemented interfaces
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix #34670
| License | MIT
| Doc PR | -
Commits
-------
739357656d
[DI] fix overriding existing services with aliases for singly-implemented interfaces
This commit is contained in:
commit
c222aaae70
@ -121,7 +121,7 @@ abstract class FileLoader extends BaseFileLoader
|
||||
public function registerAliasesForSinglyImplementedInterfaces()
|
||||
{
|
||||
foreach ($this->interfaces as $interface) {
|
||||
if (!empty($this->singlyImplemented[$interface]) && !$this->container->hasAlias($interface)) {
|
||||
if (!empty($this->singlyImplemented[$interface]) && !$this->container->has($interface)) {
|
||||
$this->container->setAlias($interface, $this->singlyImplemented[$interface])->setPublic(false);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user