jjok/di

This package is abandoned and no longer maintained. No replacement package was suggested.

Super-simple dependency injection for PHP.

0.2.0 2013-10-08 15:54 UTC

This package is not auto-updated.

Last update: 2020-01-20 03:37:24 UTC


README

Build Status

Super-simple dependency injection for PHP.

It's a bit like Pimple, but has a namespace and does less stuff.

Example

$container = new \jjok\DI\Container(array(
    'SomeDependency' => function($self, $param) {
    	return new SomeDependency($param);
    },
    'SomeClass' => function($self) {
    	return new SomeClass($self->call('SomeDependency', 'some-param'));
    }
));

$some_object = $container->call('SomeClass');

Dependencies

Copyright (c) 2013 Jonathan Jefferies