Skip to content

Commit 373acf5

Browse files
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
2 parents ebef479 + c32383d commit 373acf5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Loader/FileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function registerClasses(Definition $prototype, $namespace, $resource, $e
121121
public function registerAliasesForSinglyImplementedInterfaces()
122122
{
123123
foreach ($this->interfaces as $interface) {
124-
if (!empty($this->singlyImplemented[$interface]) && !$this->container->hasAlias($interface)) {
124+
if (!empty($this->singlyImplemented[$interface]) && !$this->container->has($interface)) {
125125
$this->container->setAlias($interface, $this->singlyImplemented[$interface])->setPublic(false);
126126
}
127127
}

0 commit comments

Comments
 (0)