Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DI] Automatic registration of decorating service #26666

Copy link
Copy link
Closed
@zmitic

Description

@zmitic
Issue body actions
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
Symfony version 4.1

With autowiring decorators available, it would be nice if we could have them registered automatically with no yaml code.

Just like it works for EventSubscriberInterface::getSubscribedEvents(). Example:

class FooDecorator implements DecoratorInterface
{
    public static function getDecoratedService()
    {
        return Foo::class; // just the service name
        return [Foo::class, 5]; // service name, priority
    }

    public function __construct(Foo $decorated)
    {
        //...
    }   
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.