jjok / di
Super-simple dependency injection for PHP.
Installs: 2 156
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.0
- jjok/config: 2.*
This package is not auto-updated.
Last update: 2020-01-20 03:37:24 UTC
README
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