The dependency injection container for streamlined WordPress development. Easily manage and inject dependencies for efficient and hassle-free app creation.
Published by lucatume 6 months ago
3.3.7
Published by lucatume 7 months ago
3.3.6
afterBuildAll
parameter to the bindDecorators
and singletonDecorators
method, fixes #61.3.3.5
$instance = $container->get( Test::class );
(thanks @defunctl).Published by lucatume over 1 year ago
3.3.4
Container::__clone
method to clone the container accessory classes correctly upon cloning.Container::__construct
method will bind itself to the Psr\Container\ContainerInterface
interface as a singleton.Container
class is extended, it will bind itself to the extended class in the __construct
and __clone
methods.Published by lucatume over 1 year ago
3.3.3
App::callback
method to be callable
(thanks @estevao90).Published by lucatume over 1 year ago
3.3.2
Container::callback
function (thanks @estevao90).Published by lucatume over 1 year ago
3.3.1
$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);
Published by lucatume over 1 year ago
3.3.0
aliases.php
file from the package autoloading. Take a look at the README.md file to see how to gracefully upgrade to version 3.3Published by lucatume over 1 year ago
3.2.1
Published by lucatume over 1 year ago
3.2.0
App
generated methods signatures.Published by lucatume over 1 year ago
3.1.1
@since TBD
comments.Published by lucatume over 1 year ago
3.1.0
unit
suite and a php81
suite to avoid fatal parse errors when asserting enums.PHP81ContextualBindingContainerTest
runs under PHP8.1.Published by lucatume almost 2 years ago
3.0.3
Container::get()
method, instead of the new
keyword. This allows Service Providers to utilize dependency injection. (thanks @defunctl).Published by lucatume almost 2 years ago
3.0.2
Container::when()
, Container::needs()
and Container::give()
(thanks @defunctl).Published by lucatume almost 2 years ago
3.0.1
.gitattributes
file to exclude development artifacts. (thanks @Luc45)Published by lucatume over 2 years ago
3.0.0
lucatume\DI52\Container::getVar(string $key, mixed $default = null) :mixed
method.lucatume\DI52\Container::setVar(string $key, mixed $value) :void
will not try to run callables whensetVar()
method is no more required.lucatume\DI52\Container::tagged(string $tag) :array
method will now return an empty array if nothing wasgetProvider
and get
, make
or the ArrayAccess
API.tad_DI52_ServiceProviderInterface
and tad_DI52_ContainerInterface
interfaces.Published by lucatume almost 3 years ago
Published by lucatume almost 4 years ago
Published by lucatume almost 4 years ago
make
resolution (thanks @Luc45)Published by lucatume about 4 years ago
Container::callback
code to re-use callbacks when available (thanks @sc0ttkclark)callback
method would build the object for static method calls