Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DI] Fix error when trying to resolve a DefinitionDecorator#20543
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
b654edd to37bfb16Compare| */ | ||
| publicfunctioncreateService(Definition$definition,$id,$tryProxy =true) | ||
| { | ||
| if ($definitioninstanceof DefinitionDecorator) { |
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.
What about checking this in a more generic way (i.e. forbidding allDefinition subclasses)?
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.
that way?
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.
👍
37bfb16 to8e0da2fComparestof commentedNov 17, 2016
👍 |
1 similar comment
xabbuh commentedNov 17, 2016
👍 |
| publicfunctioncreateService(Definition$definition,$id,$tryProxy =true) | ||
| { | ||
| if ('Symfony\Component\DependencyInjection\Definition' !==get_class($definition)) { | ||
| thrownewRuntimeException(sprintf('Constructing service "%s" from a %s is not supported at build time.',$id,get_class($definition))); |
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.
missing"" around the second %s
fabpot commentedNov 17, 2016
Thank you@nicolas-grekas. |
…r (nicolas-grekas)This PR was merged into the 2.7 branch.Discussion----------[DI] Fix error when trying to resolve a DefinitionDecorator| Q | A| ------------- | ---| Branch? | 2.7| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -Instead of the currently obscure `ReflectionException: Class does not exist` message, let's throw a useful error message.Commits-------8e0da2f [DI] Fix error when trying to resolve a DefinitionDecorator
Instead of the currently obscure
ReflectionException: Class does not existmessage, let's throw a useful error message.