[Bridge\Doctrine] Fix BC with DI v3.4

This commit is contained in:
Nicolas Grekas 2017-07-19 17:17:35 +02:00
parent 1cac0a0bba
commit b03f0bdb06
1 changed files with 4 additions and 1 deletions

View File

@ -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);