Skip to content

Commit 19ba631

Browse files
committed
minor symfony#23594 [Bridge\Doctrine] Fix BC with DI v3.4 (nicolas-grekas)
This PR was merged into the 4.0-dev branch. Discussion ---------- [Bridge\Doctrine] Fix BC with DI v3.4 | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As allowed by composer.json. Code borrowed from branch 3.4 Commits ------- b03f0bd [Bridge\Doctrine] Fix BC with DI v3.4
2 parents b9cc089 + b03f0bd commit 19ba631

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Symfony/Bridge/Doctrine/ManagerRegistry.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@ protected function resetService($name)
4949
}
5050
$manager->setProxyInitializer(\Closure::bind(
5151
function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) {
52+
if (isset($this->normalizedIds[$normalizedId = strtolower($name)])) { // BC with DI v3.4
53+
$name = $this->normalizedIds[$normalizedId];
54+
}
5255
if (isset($this->aliases[$name])) {
5356
$name = $this->aliases[$name];
5457
}
55-
$method = $this->methodMap[$name] ?? 'get'.$name.'Service';
58+
$method = $this->methodMap[$name] ?? 'get'.strtr($name, $this->underscoreMap).'Service'; // BC with DI v3.4
5659
$wrappedInstance = $this->{$method}(false);
5760

5861
$manager->setProxyInitializer(null);

0 commit comments

Comments
 (0)