Skip to content

[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

Merged
merged 1 commit into from
Jul 29, 2018
Merged

[DI] Improve class named servics error message #28057

merged 1 commit into from
Jul 29, 2018

Conversation

ro0NL
Copy link
Contributor

@ro0NL 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 '
Copy link
Contributor

@Tobion Tobion Jul 26, 2018

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.

Copy link
Contributor Author

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?

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me 👍

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Jul 26, 2018
@nicolas-grekas
Copy link
Member

Thank you @ro0NL.

@nicolas-grekas nicolas-grekas merged commit 61de060 into symfony:3.4 Jul 29, 2018
nicolas-grekas added a commit that referenced this pull request Jul 29, 2018
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
@ro0NL ro0NL deleted the di/error-msg branch July 29, 2018 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants