-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Improve class named servics error message #28057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ro0NL
commented
Jul 25, 2018
Q | A |
---|---|
Branch? | 3.4 |
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #28006 |
License | MIT |
Doc PR | symfony/symfony-docs#... |
if (0 === strpos($id, '\\') && 1 < substr_count($id, '\\')) { | ||
throw new RuntimeException(sprintf( | ||
'The definition for "%s" has no class attribute, and appears to reference a ' | ||
.'class or interface. Please specify the class attribute explicitly or rename ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about "... or remove the leading backslash by renaming the service to ..." to explain the difference. otherwise it's not obvious what the change actually is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, will do :) also i was wondering if we should include the why. If so, @nicolas-grekas how would you explain this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it doesn't work otherwise :) no reason to give here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works for me 👍
Thank you @ro0NL. |
This PR was squashed before being merged into the 3.4 branch (closes #28057). Discussion ---------- [DI] Improve class named servics error message | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #28006 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Commits ------- 61de060 [DI] Improve class named servics error message