FunctionAssembler
extends AssemblerAbstract
in package
Assembles a FunctionDescriptor from a FunctionReflector.
Tags
Table of Contents
- $argumentAssembler : ArgumentAssembler
- $builder : ProjectDescriptorBuilder|null
- $reducers : array<string|int, AssemblerReducer>
- __construct() : mixed
- Initializes this assembler and its dependencies.
- create() : TDescriptor|null
- Creates a Descriptor from the provided data.
- deduplicateTypes() : Type|null
- getBuilder() : ProjectDescriptorBuilder|null
- Returns the builder for this Assembler or null if none is set.
- setBuilder() : void
- Registers the Builder with this Assembler.
- addArgumentDescriptorToFunction() : void
- Adds the given argument to the function.
- addArgumentsToFunctionDescriptor() : void
- Converts each argument reflector to an argument descriptor and adds it to the function descriptor.
- assembleDocBlock() : void
- Assemble DocBlock.
- buildDescriptor() : TDescriptor|null
- createArgumentDescriptor() : ArgumentDescriptor
- Creates a new ArgumentDescriptor from the given Reflector and Param.
- extractPackageFromDocBlock() : string|null
- Extracts the package from the DocBlock.
- mapReflectorPropertiesOntoDescriptor() : void
- Maps the properties of the Function reflector onto the Descriptor.
- pretifyValue() : string|null
Properties
$argumentAssembler
protected
ArgumentAssembler
$argumentAssembler
$builder
protected
ProjectDescriptorBuilder|null
$builder
$reducers
private
array<string|int, AssemblerReducer>
$reducers
Methods
__construct()
Initializes this assembler and its dependencies.
public
__construct(ArgumentAssembler $argumentAssembler) : mixed
Parameters
- $argumentAssembler : ArgumentAssembler
Return values
mixed —create()
Creates a Descriptor from the provided data.
public
create(Function_ $data) : TDescriptor|null
Parameters
- $data : Function_
Return values
TDescriptor|null —deduplicateTypes()
public
static deduplicateTypes(Type|null $type) : Type|null
Parameters
- $type : Type|null
Tags
Return values
Type|null —getBuilder()
Returns the builder for this Assembler or null if none is set.
public
getBuilder() : ProjectDescriptorBuilder|null
Return values
ProjectDescriptorBuilder|null —setBuilder()
Registers the Builder with this Assembler.
public
setBuilder(ProjectDescriptorBuilder $builder) : void
The Builder may be used to recursively assemble Descriptors using the method.
Parameters
- $builder : ProjectDescriptorBuilder
Return values
void —addArgumentDescriptorToFunction()
Adds the given argument to the function.
protected
addArgumentDescriptorToFunction(FunctionDescriptor $functionDescriptor, ArgumentDescriptor $argumentDescriptor) : void
Parameters
- $functionDescriptor : FunctionDescriptor
- $argumentDescriptor : ArgumentDescriptor
Return values
void —addArgumentsToFunctionDescriptor()
Converts each argument reflector to an argument descriptor and adds it to the function descriptor.
protected
addArgumentsToFunctionDescriptor(array<string|int, Argument> $arguments, FunctionDescriptor $functionDescriptor) : void
Parameters
- $arguments : array<string|int, Argument>
- $functionDescriptor : FunctionDescriptor
Return values
void —assembleDocBlock()
Assemble DocBlock.
protected
assembleDocBlock(DocBlock|null $docBlock, DescriptorAbstract $target) : void
Parameters
- $docBlock : DocBlock|null
- $target : DescriptorAbstract
Return values
void —buildDescriptor()
protected
buildDescriptor(TInput $data) : TDescriptor|null
Parameters
- $data : TInput
Return values
TDescriptor|null —createArgumentDescriptor()
Creates a new ArgumentDescriptor from the given Reflector and Param.
protected
createArgumentDescriptor(FunctionDescriptor $functionDescriptor, Argument $argument) : ArgumentDescriptor
Parameters
- $functionDescriptor : FunctionDescriptor
- $argument : Argument
Return values
ArgumentDescriptor —extractPackageFromDocBlock()
Extracts the package from the DocBlock.
protected
extractPackageFromDocBlock(DocBlock|null $docBlock) : string|null
Parameters
- $docBlock : DocBlock|null
Return values
string|null —mapReflectorPropertiesOntoDescriptor()
Maps the properties of the Function reflector onto the Descriptor.
protected
mapReflectorPropertiesOntoDescriptor(Function_ $reflector, FunctionDescriptor $descriptor) : void
Parameters
- $reflector : Function_
- $descriptor : FunctionDescriptor
Return values
void —pretifyValue()
protected
pretifyValue(string|null $value) : string|null
Parameters
- $value : string|null