ObjectCreationCompiler
in package
Compiles an object definition into native PHP code that, when executed, creates the object.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- compile() : string
- resolveParameters() : array<string|int, mixed>
- assertClassIsInstantiable() : void
- assertClassIsNotAnonymous() : void
- compileLazyDefinition() : string
- getFunctionName() : string
- getParameterDefaultValue() : mixed
- Returns the default value of a function parameter.
Properties
$compiler
private
Compiler
$compiler
Methods
__construct()
public
__construct(Compiler $compiler) : mixed
Parameters
- $compiler : Compiler
compile()
public
compile(ObjectDefinition $definition) : string
Parameters
- $definition : ObjectDefinition
Return values
stringresolveParameters()
public
resolveParameters(MethodInjection|null $definition, ReflectionMethod|null $method) : array<string|int, mixed>
Parameters
- $definition : MethodInjection|null
- $method : ReflectionMethod|null
Return values
array<string|int, mixed>assertClassIsInstantiable()
private
assertClassIsInstantiable(ObjectDefinition $definition) : void
Parameters
- $definition : ObjectDefinition
assertClassIsNotAnonymous()
private
assertClassIsNotAnonymous(ObjectDefinition $definition) : void
Parameters
- $definition : ObjectDefinition
compileLazyDefinition()
private
compileLazyDefinition(ObjectDefinition $definition) : string
Parameters
- $definition : ObjectDefinition
Return values
stringgetFunctionName()
private
getFunctionName(ReflectionMethod $method) : string
Parameters
- $method : ReflectionMethod
Return values
stringgetParameterDefaultValue()
Returns the default value of a function parameter.
private
getParameterDefaultValue(ReflectionParameter $parameter, ReflectionMethod $function) : mixed
Parameters
- $parameter : ReflectionParameter
- $function : ReflectionMethod