Skip to content

debug:container --types & debug:autowiring can fail with missing deps #24639

Closed
@weaverryan

Description

@weaverryan
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3 (I believe)

Here's the setup:

  1. Use Flex
  2. Install SensioFrameworkExtraBundle
  3. Run bin/console debug:container --types

screen shot 2017-10-19 at 7 26 28 pm

The issue is that SensioFrameworkExtraBundle registers a service that relies on symfony/security. Since security is not present, this service is removed: https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/master/DependencyInjection/Compiler/OptimizerPass.php#L27

However, I believe that the debug:container command uses the container before some of these removal passes. So, this service is still present when we check to see if the class exists: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php#L248. The autoloader causes the class to be loaded, and error because the parent class is missing.

So... long way of saying, we just need a safer way of checking to see if the service id is an existent class.

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