minor #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 #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 | #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
-------

9ade232533 [DoctrineBridge] [DX] Update exception text in ManagerRegistry::resetService to avoid confusion.
This commit is contained in:
Nicolas Grekas 2019-04-15 11:42:25 +02:00
commit 76647a78bd
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) {