Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DependencyInjection] Don't autoconfigure decorators#24229
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
| */ | ||
| publicfunctionsetAutoconfigured($autoconfigured) | ||
| { | ||
| if (null !==$this->decoratedService &&$autoconfigured) { |
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.
Maybe should we also throw insetDecoratedService if$autoconfigured istrue?
nicolas-grekas commentedSep 16, 2017
I barely see the logic link between the original issue and making autoconfig/decoration conflict. Can you explain why they should? What is causing the reported exception precisely? |
nicolas-grekas commentedSep 16, 2017
So, debugging this, I'm 👎 on this patch, but would propose another solution: --- a/src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php+++ b/src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php@@ -119,6 +119,7 @@ class ResolveInstanceofConditionalsPass implements CompilerPassInterface $abstract ->setArguments(array()) ->setMethodCalls(array())+ ->setDecoratedService(null) ->setTags(array()) ->setAbstract(true); } I'll let you do the PR if you don't mind? |
dunglas commentedSep 16, 2017
Closing in favor of#24234. Thanks for debugging this@nicolas-grekas. |
…tionalsPass (dunglas)This PR was merged into the 3.3 branch.Discussion----------[DI] Fix decorated service merge in ResolveInstanceofConditionalsPass| Q | A| ------------- | ---| Branch? | 3.3| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |api-platform/api-platform#414,#24229| License | MIT| Doc PR | n/aFollows#24229. It's [the patch](#24229 (comment)) proposed by@nicolas-grekas + a test.Commits-------2a30908 [DI] Fix decorated service merge in ResolveInstanceofConditionalsPass
Autoconfiguring decorators create strange problems like this oneapi-platform/api-platform#414.
As autoconfiguring is on by default when using Symfony SE 3.3, it's better to give an explicit error to the end user.
TODO: