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 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 (closessymfony#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.
Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/ManagerRegistry.php
+1-1
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ protected function resetService($name)
46
46
$manager = $this->container->get($name);
47
47
48
48
if (!$managerinstanceof LazyLoadingInterface) {
49
-
thrownew \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
+
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
50
}
51
51
$manager->setProxyInitializer(\Closure::bind(
52
52
function (&$wrappedInstance, LazyLoadingInterface$manager) use ($name) {
0 commit comments