Skip to content

Support for map of tagged services as service decency #6102

Closed
@andrerom

Description

@andrerom

Just like #5012 proposes a solution to avoid having to use container to be able to lazy load services, this one is a proposal to avoid injecting container in project code when you need a map of tagged services.

Overview

Service Container should be able to inject a map of services, by tag, where map key is the alias attribute, and value is the service.

Lazy loaded maps

If the proxy proposal is accepted, a lazy loaded map could be a plain array map of proxies. But proxie objects can be avoided in this case by instead returning an object that implements ArrayAccess + Traversable + Countable and behind the scenes uses container.

Known issue: This approach has the same downside as other ContainerAware code including proxies: serialization, var_dump and var_export.

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