Releases: lucatume/di52
Releases · lucatume/di52
3.3.7
3.3.6
3.3.5
3.3.4
3.3.4
Added
- Implement the
Container::__clone
method to clone the container accessory classes correctly upon cloning.
Changed
- The
Container::__construct
method will bind itself to thePsr\Container\ContainerInterface
interface as a singleton. - If the
Container
class is extended, it will bind itself to the extended class in the__construct
and__clone
methods.
3.3.3
3.3.2
3.3.1
3.3.1
Fixed
- Allow bound interfaces to properly resolve their concrete class when the concrete class has contextual bindings (thanks @defunctl). e.g. the following will now work properly:
$container = new \lucatume\DI52\Container();
$container->bind(SomeInterface::class, SomeClass::class);
$container->when(Someclass:class)
->needs('$num')
->give(20);
// This now works, properly resolving SomeClass::class.
$instance = $container->get(SomeInterface::class);