Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/phmlabs/init

Lightweight dependency injection framework
https://github.com/phmlabs/init

Last synced: 11 days ago
JSON representation

Lightweight dependency injection framework

Awesome Lists containing this project

README

        

# phmLabs::Init

This library is a very lightweight dependency injection container. The special thing about `Init` is that it uses names parameters and fits perfectly with yaml files this way.

````php
class MyClass {
public function __construct($firstParam, $secondParam = null) {
// ...
}
}

$options = [
'class' => 'MyClass',
'call' => [
'__construct' => ['secondParam' => 'foo', 'firstParam' => 'bar']
]
]

$myClass = Init::initialize($options);
````