ObjectDefinition
in package
implements
Definition
Defines how an object can be instantiated.
Tags
Table of Contents
Interfaces
- Definition
Properties
- $className : string|null
- Class name (if null, then the class name is $name).
- $constructorInjection : MethodInjection|null
- $lazy : bool|null
- $methodInjections : array<string|int, array<string|int, MethodInjection>>
- Method calls.
- $propertyInjections : array<string|int, mixed>
- $classExists : bool
- Store if the class exists. Storing it (in cache) avoids recomputing this.
- $isInstantiable : bool
- Store if the class is instantiable. Storing it (in cache) avoids recomputing this.
- $name : string
- Entry name (most of the time, same as $classname).
Methods
- __construct() : mixed
- __toString() : string
- addMethodInjection() : void
- addPropertyInjection() : void
- classExists() : bool
- completeConstructorInjection() : void
- completeFirstMethodInjection() : void
- getClassName() : string
- getConstructorInjection() : MethodInjection|null
- getMethodInjections() : array<string|int, MethodInjection>
- getName() : string
- getPropertyInjections() : array<string|int, PropertyInjection>
- isInstantiable() : bool
- isLazy() : bool
- replaceNestedDefinitions() : void
- replaceWildcards() : void
- Replaces all the wildcards in the string with the given replacements.
- setClassName() : void
- setConstructorInjection() : void
- setLazy() : void
- setName() : void
- updateCache() : void
Properties
$className
Class name (if null, then the class name is $name).
protected
string|null
$className
= null
$constructorInjection
protected
MethodInjection|null
$constructorInjection
= null
$lazy
protected
bool|null
$lazy
= null
$methodInjections
Method calls.
protected
array<string|int, array<string|int, MethodInjection>>
$methodInjections
= []
$propertyInjections
protected
array<string|int, mixed>
$propertyInjections
= []
$classExists
Store if the class exists. Storing it (in cache) avoids recomputing this.
private
bool
$classExists
$isInstantiable
Store if the class is instantiable. Storing it (in cache) avoids recomputing this.
private
bool
$isInstantiable
$name
Entry name (most of the time, same as $classname).
private
string
$name
Methods
__construct()
public
__construct(string $name[, string|null $className = null ]) : mixed
Parameters
- $name : string
-
Entry name
- $className : string|null = null
__toString()
public
__toString() : string
Return values
stringaddMethodInjection()
public
addMethodInjection(MethodInjection $methodInjection) : void
Parameters
- $methodInjection : MethodInjection
addPropertyInjection()
public
addPropertyInjection(PropertyInjection $propertyInjection) : void
Parameters
- $propertyInjection : PropertyInjection
classExists()
public
classExists() : bool
Return values
boolcompleteConstructorInjection()
public
completeConstructorInjection(MethodInjection $injection) : void
Parameters
- $injection : MethodInjection
completeFirstMethodInjection()
public
completeFirstMethodInjection(MethodInjection $injection) : void
Parameters
- $injection : MethodInjection
getClassName()
public
getClassName() : string
Return values
stringgetConstructorInjection()
public
getConstructorInjection() : MethodInjection|null
Return values
MethodInjection|nullgetMethodInjections()
public
getMethodInjections() : array<string|int, MethodInjection>
Return values
array<string|int, MethodInjection> —Method injections
getName()
public
getName() : string
Return values
stringgetPropertyInjections()
public
getPropertyInjections() : array<string|int, PropertyInjection>
Return values
array<string|int, PropertyInjection> —Property injections
isInstantiable()
public
isInstantiable() : bool
Return values
boolisLazy()
public
isLazy() : bool
Return values
boolreplaceNestedDefinitions()
public
replaceNestedDefinitions(callable $replacer) : void
Parameters
- $replacer : callable
replaceWildcards()
Replaces all the wildcards in the string with the given replacements.
public
replaceWildcards(array<string|int, string> $replacements) : void
Parameters
- $replacements : array<string|int, string>
setClassName()
public
setClassName(string|null $className) : void
Parameters
- $className : string|null
setConstructorInjection()
public
setConstructorInjection(MethodInjection $constructorInjection) : void
Parameters
- $constructorInjection : MethodInjection
setLazy()
public
setLazy([bool|null $lazy = null ]) : void
Parameters
- $lazy : bool|null = null
setName()
public
setName(string $name) : void
Parameters
- $name : string
updateCache()
private
updateCache() : void