FileAssembler
extends AssemblerAbstract
in package
Assembles an FileDescriptor using an FileReflector and ParamDescriptors.
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.
- addClasses() : void
- Registers the child classes with the generated File Descriptor.
- addConstants() : void
- Registers the child constants with the generated File Descriptor.
- addFunctions() : void
- Registers the child functions with the generated File Descriptor.
- addInterfaces() : void
- Registers the child interfaces with the generated File Descriptor.
- addMarkers() : void
- Registers the markers that were found in a File with the File Descriptor.
- addTraits() : void
- Registers the child traits with the generated File Descriptor.
- assembleDocBlock() : void
- Assemble DocBlock.
- buildDescriptor() : TDescriptor|null
- extractPackageFromDocBlock() : string|null
- Extracts the package from the DocBlock.
- overridePackageTag() : void
- 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(File $data) : TDescriptor|null
Parameters
- $data : File
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 —addClasses()
Registers the child classes with the generated File Descriptor.
protected
addClasses(array<string|int, Class_> $classes, FileDescriptor $fileDescriptor) : void
Parameters
- $classes : array<string|int, Class_>
- $fileDescriptor : FileDescriptor
Return values
void —addConstants()
Registers the child constants with the generated File Descriptor.
protected
addConstants(array<string|int, Constant> $constants, FileDescriptor $fileDescriptor) : void
Parameters
- $constants : array<string|int, Constant>
- $fileDescriptor : FileDescriptor
Return values
void —addFunctions()
Registers the child functions with the generated File Descriptor.
protected
addFunctions(array<string|int, Function_> $functions, FileDescriptor $fileDescriptor) : void
Parameters
- $functions : array<string|int, Function_>
- $fileDescriptor : FileDescriptor
Return values
void —addInterfaces()
Registers the child interfaces with the generated File Descriptor.
protected
addInterfaces(array<string|int, Interface_> $interfaces, FileDescriptor $fileDescriptor) : void
Parameters
- $interfaces : array<string|int, Interface_>
- $fileDescriptor : FileDescriptor
Return values
void —addMarkers()
Registers the markers that were found in a File with the File Descriptor.
protected
addMarkers(array<string|int, array<string|int, string>> $markers, FileDescriptor $fileDescriptor) : void
Parameters
- $markers : array<string|int, array<string|int, string>>
- $fileDescriptor : FileDescriptor
Return values
void —addTraits()
Registers the child traits with the generated File Descriptor.
protected
addTraits(array<string|int, Trait_> $traits, FileDescriptor $fileDescriptor) : void
Parameters
- $traits : array<string|int, Trait_>
- $fileDescriptor : FileDescriptor
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 —overridePackageTag()
protected
overridePackageTag(File $data, FileDescriptor $fileDescriptor) : void
Parameters
- $data : File
- $fileDescriptor : FileDescriptor
Return values
void —pretifyValue()
protected
pretifyValue(string|null $value) : string|null
Parameters
- $value : string|null