minor #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
-------
b03f0bdb06
[Bridge\Doctrine] Fix BC with DI v3.4
This commit is contained in:
commit
19ba63125d
@ -49,10 +49,13 @@ abstract class ManagerRegistry extends AbstractManagerRegistry implements Contai
|
|||||||
}
|
}
|
||||||
$manager->setProxyInitializer(\Closure::bind(
|
$manager->setProxyInitializer(\Closure::bind(
|
||||||
function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) {
|
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])) {
|
if (isset($this->aliases[$name])) {
|
||||||
$name = $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);
|
$wrappedInstance = $this->{$method}(false);
|
||||||
|
|
||||||
$manager->setProxyInitializer(null);
|
$manager->setProxyInitializer(null);
|
||||||
|
Reference in New Issue
Block a user