Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #36389 [DI] allow decorators to reference their decorated ser…
…vice using the special `.inner` id (nicolas-grekas) This PR was merged into the 5.1-dev branch. Discussion ---------- [DI] allow decorators to reference their decorated service using the special `.inner` id | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Right now, when one wants to decorate a service, one needs to reference the decorated service using `foo.inner`, where `foo` is the id of the decorating service. There are two issues with this IMHO: - it's weird to have to repeat the name of declaring service inside of it; - it doesn't play well with child definitions. In this PR, I propose to use `.inner` to fix both issues. Before: ```yaml services: decorating_service: arguments: [@decorating_service.inner] decorates: decorated_service ``` After: ```yaml services: decorating_service: arguments: [@.inner] decorates: decorated_service ``` Commits ------- 7b6f767 [DI] allow decorators to reference their decorated service using the special `.inner` id
- Loading branch information
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters