From b03f0bdb0632142793fddec172c81b4b89e003ec Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 19 Jul 2017 17:17:35 +0200 Subject: [PATCH] [Bridge\Doctrine] Fix BC with DI v3.4 --- src/Symfony/Bridge/Doctrine/ManagerRegistry.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Doctrine/ManagerRegistry.php b/src/Symfony/Bridge/Doctrine/ManagerRegistry.php index 6153166e79..38bb2f69dd 100644 --- a/src/Symfony/Bridge/Doctrine/ManagerRegistry.php +++ b/src/Symfony/Bridge/Doctrine/ManagerRegistry.php @@ -49,10 +49,13 @@ abstract class ManagerRegistry extends AbstractManagerRegistry implements Contai } $manager->setProxyInitializer(\Closure::bind( function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) { + if (isset($this->normalizedIds[$normalizedId = strtolower($name)])) { // BC with DI v3.4 + $name = $this->normalizedIds[$normalizedId]; + } if (isset($this->aliases[$name])) { $name = $this->aliases[$name]; } - $method = $this->methodMap[$name] ?? 'get'.$name.'Service'; + $method = $this->methodMap[$name] ?? 'get'.strtr($name, $this->underscoreMap).'Service'; // BC with DI v3.4 $wrappedInstance = $this->{$method}(false); $manager->setProxyInitializer(null);