[DoctrineBridge] [DX] Update exception text in ManagerRegistry::resetService to avoid confusion.

This commit is contained in:
Amrouche Hamza 2019-04-10 07:00:49 +02:00 committed by Nicolas Grekas
parent dc2edaffe2
commit 9ade232533
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ abstract class ManagerRegistry extends AbstractManagerRegistry
$manager = $this->container->get($name);
if (!$manager instanceof LazyLoadingInterface) {
throw new \LogicException(sprintf('Resetting a non-lazy manager service is not supported. Set the "%s" service as lazy and require "symfony/proxy-manager-bridge" in your composer.json file instead.', $name));
throw new \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".'));
}
$manager->setProxyInitializer(\Closure::bind(
function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) {