Skip to content

Commit 76647a7

Browse files
minor symfony#31047 [DoctrineBridge] [DX] Update exception text in ManagerRegistry to avoid confusion. (Simperfit)
This PR was submitted for the master branch but it was merged into the 4.2 branch instead (closes symfony#31047). Discussion ---------- [DoctrineBridge] [DX] Update exception text in ManagerRegistry to avoid confusion. | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yesish <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | symfony#29659 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Since the last PR was closed and the ticket is still open, taking it since it was already done by Nicolas in the comments. Commits ------- 9ade232 [DoctrineBridge] [DX] Update exception text in ManagerRegistry::resetService to avoid confusion.
2 parents dc2edaf + 9ade232 commit 76647a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Bridge/Doctrine/ManagerRegistry.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function resetService($name)
4646
$manager = $this->container->get($name);
4747

4848
if (!$manager instanceof LazyLoadingInterface) {
49-
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));
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".'));
5050
}
5151
$manager->setProxyInitializer(\Closure::bind(
5252
function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) {

0 commit comments

Comments
 (0)