Skip to content

[DependencyInjection] Defaults are not used for ContainerInterface controller argument #48192

Closed
@lyrixx

Description

@lyrixx

Symfony version(s) affected

many

Description

With this configuration:

services:
    _defaults:
        autowire: true
        autoconfigure: true
        bind:
            Psr\Container\ContainerInterface $workflowsLocator2: !tagged_locator { tag: workflow, index_by: name }

and this controller:

    public function debug(ContainerInterface $workflowsLocator2)
    {
        dd([
            'workflowsLocator2' => $workflowsLocator2,
        ]);
    }

I expect to have all workflows, but it's not the case.

Fun fact

  1. it works with iterator
  2. but not locator
  3. if I use a constructor, it's OK

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