thephpleague / container

Small but powerful dependency injection container

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How swap added definition

barbosa89 opened this issue Β· comments

How could I swap or replace an object added to container?

The idea is swap a concrete object, use a mock instead original object.

Thanks πŸ™

Code example to swap objects into container:

$container->extend(Acme\Foo::class)->setConcrete(Acme\Bar::class);