InstanceInjector
extends ObjectCreator
in package
implements
DefinitionResolver
Injects dependencies on an existing instance.
Tags
Table of Contents
Interfaces
- DefinitionResolver
- Resolves a definition to a value.
Methods
- __construct() : mixed
- isResolvable() : bool
- The definition is not resolvable if the class is not instantiable (interface or abstract) or if the class doesn't exist.
- resolve() : mixed
- Injects dependencies on an existing instance.
- setPrivatePropertyValue() : void
- injectMethodsAndProperties() : void
Methods
__construct()
public
__construct(DefinitionResolver $definitionResolver, ProxyFactory $proxyFactory) : mixed
Parameters
- $definitionResolver : DefinitionResolver
-
Used to resolve nested definitions.
- $proxyFactory : ProxyFactory
-
Used to create proxies for lazy injections.
isResolvable()
The definition is not resolvable if the class is not instantiable (interface or abstract) or if the class doesn't exist.
public
isResolvable(Definition $definition[, array<string|int, mixed> $parameters = [] ]) : bool
Parameters
- $definition : Definition
- $parameters : array<string|int, mixed> = []
-
Optional parameters to use to build the entry.
Return values
boolresolve()
Injects dependencies on an existing instance.
public
resolve(InstanceDefinition $definition[, array<string|int, mixed> $parameters = [] ]) : mixed
Parameters
- $definition : InstanceDefinition
- $parameters : array<string|int, mixed> = []
-
Optional parameters to use to build the entry.
Tags
Return values
mixed —Value obtained from the definition.
setPrivatePropertyValue()
public
static setPrivatePropertyValue(string|null $className, mixed $object, string $propertyName, mixed $propertyValue) : void
Parameters
- $className : string|null
- $object : mixed
- $propertyName : string
- $propertyValue : mixed
injectMethodsAndProperties()
protected
injectMethodsAndProperties(object $object, ObjectDefinition $objectDefinition) : void
Parameters
- $object : object
- $objectDefinition : ObjectDefinition