phpactor/container

Phpactor's DI Container

1.3.0 2019-01-01 22:44 UTC

README

Phpactor's minimal PSR-compliant dependency injection container, featuring tags and parameters

$container = new PhpactorContainer([
     'param1' => 'value1',
     'param2' => 'value2',
     // ...
]);

$container->register('Foobar', function (Container $container) {
    return new MyClass(
        $container->get(SomeOtherClass::class),
        $container->getParameter('param1')
    );
};