Releases: oliver-schoendorn/dependency-injector
Releases · oliver-schoendorn/dependency-injector
v0.2-alpha
Added an alias argument to the share method.
Usage:
<?php
interface ClassInterface {}
class ClassImplementation implements ClassInterface {}
$di = new DependencyInjector(new ReflectionHandler()));
$di->share(new ClassImplementation(), ClassInterface::class);
assert($di->resolve(ClassInterface::class) instanceof ClassImplementation::class);