Skip to content

[DI] Circular reference in autowired decorators #42791

Closed
@vudaltsov

Description

@vudaltsov

Symfony version(s) affected: 5.3.7

Description
Autowired decorators try to inject themselves and throw

Circular reference detected for service "App\ServiceDecorator",
path: "App\ServiceDecorator -> App\ServiceDecorator".

How to reproduce
https://github.com/vudaltsov/symfony-di-537-decorator-circular
Clone and install — you will see the error when clearing the cache during the composer installation.

Possible Solution
Revert #42347

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