Skip to content

[RFC] [DI][Debug] Add command to debug autoconfigure tags #26295

@codedmonkey

Description

@codedmonkey
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes
Symfony version 4.1

Inspired by symfony/symfony-docs#9229.

I've been wondering why there's no list available showing the tags that are applied on certain classes through autoconfiguration. I know it's just a small detail but I wanted to raise the issue nonetheless, autoconfiguration might be optional but so is autowiring.

I've checked out https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php, and I can see why it hasn't been added before. The command compiles the container from cache, but the container dump doesn't contain the information anymore about which classes have been wired through autoconfiguration.

It would be mainly used for debugging purposes and just to show the developer what types of services they can wire through autoconfiguration. It could be called something like

debug:container --interfaces

and explained as

Displays autoconfiguration interfaces for an application

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DebugDependencyInjectionFeatureRFCRFC = Request For Comments (proposals about features that you want to be discussed)Stalled

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions