Example usage:
use webdeveric\DI\DI;
$container = new DI();
$container->person = function() {
$person = new stdClass;
$person->name = "Test Testerson";
return $person;
};
var_dump( $container->person->name );
Please install composer if you don't have it yet.
Run composer install
to get dependencies.
Coding Style: PSR-2
Run composer setup-hooks
to setup the git pre-commit
hook.
There is a pre-commit
hook that will run phpcs
to check the coding style.
If it fails, you will not be allowed to commit.
If you add a feature, please create a test for it too.