ProjectDescriptorBuilder
Builds a Project Descriptor and underlying tree.
Table of Contents
Constants
- DEFAULT_PROJECT_NAME : mixed = 'Untitled project'
Properties
- $assemblerFactory : AssemblerFactory
- $filter : Filter
- $project : ProjectDescriptor
- $apiSpecification : ApiSpecification
- $defaultPackageName : string
- $servicesWithCustomSettings : iterable<string|int, mixed>
Methods
- __construct() : mixed
- addVersion() : void
- buildDescriptor() : Descriptor|null
- Takes the given data and attempts to build a Descriptor from it.
- createProjectDescriptor() : void
- getAssembler() : AssemblerInterface<Descriptor, TInput>|null
- Attempts to find an assembler matching the given data.
- getDefaultPackageName() : string
- getProjectDescriptor() : ProjectDescriptor
- Returns the project descriptor that is being built.
- populateApiDocumentationSet() : void
- setCustomSettings() : void
- setIncludeSource() : void
- setName() : void
- setPartials() : void
- setVisibility() : void
- usingApiSpecification() : void
- usingDefaultPackageName() : void
- filterDescriptor() : Descriptor|null
- Filters a descriptor, validates it, stores the validation results and returns the transmuted object or null if it is supposed to be removed.
- buildVersion() : VersionInterface
- guardAgainstMultipleSetsOfTheSameType() : void
- Until official support is added for versions, check whether there is 1 and fail when multiple is given.
Constants
DEFAULT_PROJECT_NAME
public
final mixed
DEFAULT_PROJECT_NAME
= 'Untitled project'
Properties
$assemblerFactory
protected
AssemblerFactory
$assemblerFactory
$filter
protected
Filter
$filter
$project
protected
ProjectDescriptor
$project
$apiSpecification
private
ApiSpecification
$apiSpecification
$defaultPackageName
private
string
$defaultPackageName
$servicesWithCustomSettings read-only
private
iterable<string|int, mixed>
$servicesWithCustomSettings
= []
Methods
__construct()
public
__construct(AssemblerFactory $assemblerFactory, Filter $filterManager[, iterable<string|int, WithCustomSettings> $servicesWithCustomSettings = [] ]) : mixed
Parameters
- $assemblerFactory : AssemblerFactory
- $filterManager : Filter
- $servicesWithCustomSettings : iterable<string|int, WithCustomSettings> = []
addVersion()
public
addVersion(VersionSpecification $version) : void
Parameters
- $version : VersionSpecification
buildDescriptor()
Takes the given data and attempts to build a Descriptor from it.
public
buildDescriptor(object $data, Descriptor> $type) : Descriptor|null
Parameters
- $data : object
- $type : Descriptor>
Tags
Return values
Descriptor|null —constructed Desciptor, null when desciptor is filtered
createProjectDescriptor()
public
createProjectDescriptor() : void
getAssembler()
Attempts to find an assembler matching the given data.
public
getAssembler(TInput $data, Descriptor> $type) : AssemblerInterface<Descriptor, TInput>|null
Parameters
- $data : TInput
- $type : Descriptor>
Return values
AssemblerInterface<Descriptor, TInput>|nullgetDefaultPackageName()
public
getDefaultPackageName() : string
Return values
stringgetProjectDescriptor()
Returns the project descriptor that is being built.
public
getProjectDescriptor() : ProjectDescriptor
Return values
ProjectDescriptorpopulateApiDocumentationSet()
public
populateApiDocumentationSet(ApiDocumentationSet $apiSet, Project $project) : void
Parameters
- $apiSet : ApiDocumentationSet
- $project : Project
setCustomSettings()
public
setCustomSettings(array<string, string> $customSettings) : void
Parameters
- $customSettings : array<string, string>
setIncludeSource()
public
setIncludeSource(bool $includeSource) : void
Parameters
- $includeSource : bool
setName()
public
setName(string $title) : void
Parameters
- $title : string
setPartials()
public
setPartials(Collection<string|int, string> $partials) : void
Parameters
- $partials : Collection<string|int, string>
setVisibility()
public
setVisibility(int $visibility) : void
Parameters
- $visibility : int
usingApiSpecification()
public
usingApiSpecification(ApiSpecification $apiSpecification) : void
Parameters
- $apiSpecification : ApiSpecification
usingDefaultPackageName()
public
usingDefaultPackageName(string $name) : void
Parameters
- $name : string
filterDescriptor()
Filters a descriptor, validates it, stores the validation results and returns the transmuted object or null if it is supposed to be removed.
protected
filterDescriptor(Descriptor $descriptor) : Descriptor|null
Parameters
- $descriptor : Descriptor
-
Descriptor to filter
Return values
Descriptor|null —Filtered Descriptor or null if it is supposed to be removed
buildVersion()
private
buildVersion(VersionSpecification $version) : VersionInterface
Parameters
- $version : VersionSpecification
Return values
VersionInterfaceguardAgainstMultipleSetsOfTheSameType()
Until official support is added for versions, check whether there is 1 and fail when multiple is given.
private
guardAgainstMultipleSetsOfTheSameType(VersionSpecification $version) : void
By adding this restriction, it should prevent confusion with users when they were to add multiple in the configuration.
Parameters
- $version : VersionSpecification