Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0d47fdf

Browse filesBrowse files
guilliamxaviernicolas-grekas
authored andcommitted
[DoctrineBridge] [DX] Improve condition for exception text in ManagerRegistry to avoid confusion
1 parent c2e1764 commit 0d47fdf
Copy full SHA for 0d47fdf

File tree

1 file changed

+2
-1
lines changed
Filter options

1 file changed

+2
-1
lines changed

‎src/Symfony/Bridge/Doctrine/ManagerRegistry.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/ManagerRegistry.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Doctrine\Persistence\AbstractManagerRegistry;
1515
use ProxyManager\Proxy\LazyLoadingInterface;
16+
use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator;
1617
use Symfony\Component\DependencyInjection\Container;
1718

1819
/**
@@ -46,7 +47,7 @@ protected function resetService($name)
4647
$manager = $this->container->get($name);
4748

4849
if (!$manager instanceof LazyLoadingInterface) {
49-
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".'));
50+
throw new \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".'));
5051
}
5152
$manager->setProxyInitializer(\Closure::bind(
5253
function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.