ClassAssembler
extends AssemblerAbstract
in package
Assembles an ClassDescriptor using an ClassReflector.
Tags
Table of Contents
- $builder : ProjectDescriptorBuilder|null
- $reducers : array<string|int, AssemblerReducer>
- __construct() : mixed
- 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.
- addConstants() : void
- Registers the child constants with the generated Class Descriptor.
- addMethods() : void
- Registers the child methods with the generated Class Descriptor.
- addProperties() : void
- Registers the child properties with the generated Class Descriptor.
- addUses() : void
- Registers the used traits with the generated Class Descriptor.
- assembleDocBlock() : void
- Assemble DocBlock.
- buildDescriptor() : TDescriptor|null
- extractPackageFromDocBlock() : string|null
- Extracts the package from the DocBlock.
- pretifyValue() : string|null
Properties
$builder
protected
ProjectDescriptorBuilder|null
$builder
$reducers
private
array<string|int, AssemblerReducer>
$reducers
Methods
__construct()
public
__construct(AssemblerReducer ...$reducers) : mixed
Parameters
- $reducers : AssemblerReducer
Return values
mixed —create()
Creates a Descriptor from the provided data.
public
create(Class_ $data) : TDescriptor|null
Parameters
- $data : Class_
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 —addConstants()
Registers the child constants with the generated Class Descriptor.
protected
addConstants(array<string|int, Constant> $constants, ClassDescriptor $classDescriptor) : void
Parameters
- $constants : array<string|int, Constant>
- $classDescriptor : ClassDescriptor
Return values
void —addMethods()
Registers the child methods with the generated Class Descriptor.
protected
addMethods(array<string|int, Method> $methods, ClassDescriptor $classDescriptor) : void
Parameters
- $methods : array<string|int, Method>
- $classDescriptor : ClassDescriptor
Return values
void —addProperties()
Registers the child properties with the generated Class Descriptor.
protected
addProperties(array<string|int, Property> $properties, ClassDescriptor $classDescriptor) : void
Parameters
- $properties : array<string|int, Property>
- $classDescriptor : ClassDescriptor
Return values
void —addUses()
Registers the used traits with the generated Class Descriptor.
protected
addUses(array<string|int, Fqsen> $traits, ClassDescriptor $classDescriptor) : void
Parameters
- $traits : array<string|int, Fqsen>
- $classDescriptor : ClassDescriptor
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 —pretifyValue()
protected
pretifyValue(string|null $value) : string|null
Parameters
- $value : string|null