Skip to content

[DI] Automatic registration of decorating service #26666

Closed
@zmitic

Description

@zmitic
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