thephpleague / container

Small but powerful dependency injection container

Home Page:http://container.thephpleague.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Container ver 2 to ver 3

moxival opened this issue · comments

Hi,
we are having major difficulties upgrading from version 2 to version 3, it is really a different container with totally different API.

One part that is really unsolvable for us is the fact that the new League\Container\Container::share or League\Container\Container::add always adds a new definition of the service that one tries to add to the container and in ver2 the container would check if the definition already exists and if it does it would replace it with the new definition.

Can you bring back this functionality @philsturgeon ?
We would not mind if it is "locked" behind a param of the add/share method.

Hi, the explicit change to check on creation of a definition was removed yes, however, functionally it is still the same, it just means that it will hit the first definition you add on retrieving the service.

Closing due to lack of activity