Skip to content

[DependencyInjection] Improve documentation about differences between AutowireIterator and AutowireLocator #20260

Closed
@etshy

Description

@etshy

The doc about these Attributes states

To receive an iterable instead of a service locator, you can switch the AutowireLocator attribute to AutowireIterator attribute.

Though these two Attributes are not "switchable" as-is because AutowireLocator can accept a string (tag) or an array of class (classname or SubscribedService) while AutowireIterator can only accept a string (tag).

If it's intended maybe, the doc should make the difference clear, especially because there is no example of usage of AutowireIterator.
It it's not intended, then the problem lies in DependencyInjection code and AutowireIterator should be able to accept an array of class too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DependencyInjectionhasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions