Skip to content

Support for map of tagged services as service decency #6102

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy