MethodAssembler
extends AssemblerAbstract
in package
Assembles a MethodDescriptor from a MethodReflector.
Tags
Table of Contents
- $argumentAssembler : ArgumentAssembler
- $builder : ProjectDescriptorBuilder|null
- $reducers : array<string|int, AssemblerReducer>
- __construct() : mixed
- Initializes this assembler with 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.
- addArgument() : void
- Adds a single reflected Argument to the Method Descriptor.
- addArguments() : void
- Adds the reflected Arguments to the Descriptor.
- addVariadicArgument() : void
- Checks if there is a variadic argument in the `@param` tags and adds it to the list of Arguments in the Descriptor unless there is already one present.
- assembleDocBlock() : void
- Assemble DocBlock.
- buildDescriptor() : TDescriptor|null
- extractPackageFromDocBlock() : string|null
- Extracts the package from the DocBlock.
- mapReflectorToDescriptor() : void
- Maps the fields to the reflector to 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 with its dependencies.
public
__construct(ArgumentAssembler $argumentAssembler) : mixed
Parameters
- $argumentAssembler : ArgumentAssembler
Return values
mixed —create()
Creates a Descriptor from the provided data.
public
create(Method $data) : TDescriptor|null
Parameters
- $data : Method
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 —addArgument()
Adds a single reflected Argument to the Method Descriptor.
protected
addArgument(Argument $argument, MethodDescriptor $descriptor) : void
Parameters
- $argument : Argument
- $descriptor : MethodDescriptor
Return values
void —addArguments()
Adds the reflected Arguments to the Descriptor.
protected
addArguments(Method $reflector, MethodDescriptor $descriptor) : void
Parameters
- $reflector : Method
- $descriptor : MethodDescriptor
Return values
void —addVariadicArgument()
Checks if there is a variadic argument in the `@param` tags and adds it to the list of Arguments in the Descriptor unless there is already one present.
protected
addVariadicArgument(Method $data, MethodDescriptor $methodDescriptor) : void
Parameters
- $data : Method
- $methodDescriptor : MethodDescriptor
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 —extractPackageFromDocBlock()
Extracts the package from the DocBlock.
protected
extractPackageFromDocBlock(DocBlock|null $docBlock) : string|null
Parameters
- $docBlock : DocBlock|null
Return values
string|null —mapReflectorToDescriptor()
Maps the fields to the reflector to the descriptor.
protected
mapReflectorToDescriptor(Method $reflector, MethodDescriptor $descriptor) : void
Parameters
- $reflector : Method
- $descriptor : MethodDescriptor
Return values
void —pretifyValue()
protected
pretifyValue(string|null $value) : string|null
Parameters
- $value : string|null