You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #35396 [DoctrineBridge] [DX] Improve condition for exception text in ManagerRegistry to avoid confusion (guilliamxavier)
This PR was submitted for the 4.4 branch but it was merged into the 4.3 branch instead.
Discussion
----------
[DoctrineBridge] [DX] Improve condition for exception text in ManagerRegistry to avoid confusion
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yesish
| New feature? | no
| Deprecations? | no
| Tickets | Fix#31047 (comment)
| License | MIT
| Doc PR | -
(Targetting 4.4 because 4.3 is already almost EOM)
Commits
-------
0d47fdf [DoctrineBridge] [DX] Improve condition for exception text in ManagerRegistry to avoid confusion
@@ -46,7 +47,7 @@ protected function resetService($name)
46
47
$manager = $this->container->get($name);
47
48
48
49
if (!$managerinstanceof LazyLoadingInterface) {
49
-
thrownew \LogicException('Resetting a non-lazy manager service is not supported. '.(interface_exists(LazyLoadingInterface::class) ? sprintf('Declare the "%s" service as lazy.', $name) : 'Try running "composer require symfony/proxy-manager-bridge".'));
50
+
thrownew \LogicException('Resetting a non-lazy manager service is not supported. '.(interface_exists(LazyLoadingInterface::class) && class_exists(RuntimeInstantiator::class) ? sprintf('Declare the "%s" service as lazy.', $name) : 'Try running "composer require symfony/proxy-manager-bridge".'));
50
51
}
51
52
$manager->setProxyInitializer(\Closure::bind(
52
53
function (&$wrappedInstance, LazyLoadingInterface$manager) use ($name) {
0 commit comments