Di
in package
Table of Contents
Constants
- DEFAULT_INJECT_METHOD_NAME = '_inject'
Properties
- $container : mixed
- $fallback : Di
Methods
- __construct() : mixed
- get() : mixed
- injectDependencies() : mixed
- instantiate() : null|object
- set() : mixed
- prepareArgs() : array<string|int, mixed>
Constants
DEFAULT_INJECT_METHOD_NAME
public
mixed
DEFAULT_INJECT_METHOD_NAME
= '_inject'
Properties
$container
protected
mixed
$container
= []
$fallback
protected
Di
$fallback
Methods
__construct()
public
__construct([mixed $fallback = null ]) : mixed
Parameters
- $fallback : mixed = null
get()
public
get(mixed $className) : mixed
Parameters
- $className : mixed
injectDependencies()
public
injectDependencies(mixed $object[, string $injectMethodName = self::DEFAULT_INJECT_METHOD_NAME ][, mixed $defaults = [] ]) : mixed
Parameters
- $object : mixed
- $injectMethodName : string = self::DEFAULT_INJECT_METHOD_NAME
-
Method which will be invoked with resolved dependencies as its arguments
- $defaults : mixed = []
Tags
instantiate()
public
instantiate(string $className[, array<string|int, mixed> $constructorArgs = null ][, string $injectMethodName = self::DEFAULT_INJECT_METHOD_NAME ]) : null|object
Parameters
- $className : string
- $constructorArgs : array<string|int, mixed> = null
- $injectMethodName : string = self::DEFAULT_INJECT_METHOD_NAME
-
Method which will be invoked after object creation; Resolved dependencies will be passed to it as arguments
Tags
Return values
null|objectset()
public
set(mixed $class) : mixed
Parameters
- $class : mixed
prepareArgs()
protected
prepareArgs(ReflectionMethod $method[, mixed $defaults = [] ]) : array<string|int, mixed>
Parameters
- $method : ReflectionMethod
- $defaults : mixed = []