Skip to content

TaggedLocator/TaggedIterator attributes does not work in controller argument #49083

@lyrixx

Description

@lyrixx

Description

It would be super cool to be able to write such code:

    #[Route('/')]
    public function index(
        #[TaggedLocator('foobar')]
        ContainerInterface $foobar,
    ): JsonResponse
    {
        dd($foo);

But it does not work ATM

Cannot autowire argument $foo of "App\Controller\AController::index()": it references interface "Psr\Container\ContainerInterface" but no such service exists. Available autowiring aliases for this interface are: "$parameterBag".

Note
It also applies to TaggedIterator

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