-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Decorate synthetic service #40784
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
Comments
I don't think it is, as setting the service would then have to actually set the inner one (while the call does not know the inner id). @nicolas-grekas should we add a dedicated error in the resolution of service decoration when trying to decorate a synthetic service to give a better error message ? |
A more specific error message would be nice yes. Up to give it a try @Firtzberg? |
I'm fine with a more detailed error message or a compiler pass which prevents this. Whatever you consider best. In case someone stumbles upon this, I am using a workaround.
The After bulding the container:
|
@Firtzberg would you be up to work on a PR to improve the error message? |
@nicolas-grekas I'm honored, but I don't think I'm up to the task. |
No worries, see #41779 |
…ng a synthetic service (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [DependencyInjection] throw proper exception when decorating a synthetic service | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #40784 | License | MIT | Doc PR | - Commits ------- b763a29 [DependencyInjection] throw proper exception when decorating a synthetic service
Is it possible to decorate a synthetic service (set at runtime)?
When I try to do so I get the error message
A synthetic service ("Vendor\Product\Decorator.inner") must be public.
Here's the YAML file
The text was updated successfully, but these errors were encountered: