laminas / laminas-servicemanager

Factory-Driven Dependency Injection Container

Home Page:https://docs.laminas.dev/laminas-servicemanager/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check that aliases work for every ServiceManager feature

Slamdunk opened this issue · comments

See laminas/laminas-form#193 (comment)

A test shold be added to ensure that Factories, Abstract Factories, Delegators, Initializers, Services and so on work well with alias and aliased references when an alias is in place

Related to my RFC in #168
Should we close here instead or should me make this one an RFC?

IMHO not a bug but a feature request tho.

I'm not 100% sure they are the same topic: I'll let you decide though as it seems you have a much deeper knowledge and experience than me here

When I understand this issue correct, you want to ensure that delegator factories are called for aliases as well.
Depending on how upstream configures/replaces SM configuration, this might not always work but at least we could add aliases delegator factories to the chain.
Everything else, i.e. factories (which makes no sense in combination with aliases) and initializers do work (as they are triggered for all created services, no matter if aliased or not).

Especially the issue you mentioned initially was one of the reason I've created the RFC as v4 is not that far away anymore.