Skip to content

Releases: oliver-schoendorn/dependency-injector

v0.2-alpha

05 Sep 14:27
Compare
Choose a tag to compare
v0.2-alpha Pre-release
Pre-release

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);