Skip to content

Autowiring aliases defined by the bundle are wrong #660

Description

@stof

Version(s) affected

4.2.x

Description

stable releases are probably also be affected, I haven't checked.

The bundle creates auto-wiring aliases referencing self::class in DI sources (I haven't checked whether they are all affected) while the actual service is not an instance of this type:

$container->registerAliasForArgument($service_id, self::class, $name . 'NestedTokenBuilder');

How to reproduce

Create a service depending on the NestedTokenLoader or NestedTokenBuilder
Use autowiring to configure the service dependencies.

Possible Solution

No response

Additional Context

Note also that Symfony 7.4 added a $target attribute in ContainerBuilder::registerAliasForArgument() which should probably be used with the config name directly (without suffixing it with things like NestedTokenLoader or NestedTokenBuilder) to make it cleaner when using the Target() attribute to select the autowired service.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions