Generates text files from multiple chunks.

A selected artifact can specify chunks of text to include in a \FeaturePhp\File\ChunkFile (see \FeaturePhp\Specification\ChunkSpecification). In the product line's generator settings, more details about chunked files (such as header and footer) can be specified (see \FeaturePhp\Generator\Settings).

package Default
inherited_from \FeaturePhp\Generator\ExtendGenerator

 Methods

Creates a generator.

__construct(\FeaturePhp\Generator\Settings $settings) 
Inherited

Parameters

$settings

\FeaturePhp\Generator\Settings

Registers an artifact whose corresponding feature is deselected.

addDeselectedArtifact(\FeaturePhp\Artifact\Artifact $artifact) 
Inherited

Parameters

$artifact

\FeaturePhp\Artifact\Artifact

Registers an artifact whose corresponding feature is selected.

addSelectedArtifact(\FeaturePhp\Artifact\Artifact $artifact) 
Inherited

Parameters

$artifact

\FeaturePhp\Artifact\Artifact

Generates the files for all registered artifacts.

generateFiles() : array<mixed,\FeaturePhp\File\File>
Inherited

If the files have already been generated, returns the cached files. The generator's log file is included.

Returns

array<mixed,\FeaturePhp\File\File>

Returns a map from all generator keys to class names.

getGeneratorMap() : array<mixed,string>
InheritedStatic

Returns

array<mixed,string>

Returns the chunk generator's key.

getKey() : string
Static

Returns

string

Returns the generator's key.

getKey() : string
InheritedStatic

The key is the name used to identify the \FeaturePhp\Generator\Settings for a generator.

Returns

string

Returns all registered artifacts (selected and deselected).

getRegisteredArtifacts() : array<mixed,\FeaturePhp\Artifact\Artifact>
Inherited

Returns

array<mixed,\FeaturePhp\Artifact\Artifact>

Returns the generator's settings.

getSettings() : \FeaturePhp\Generator\Settings
Inherited

Returns

\FeaturePhp\Generator\Settings

Returns whether any artifacts are registered with the generator.

hasArtifacts() : boolean
Inherited

Returns

boolean

Returns tracing links for all registered artifacts.

trace() : array<mixed,\FeaturePhp\Artifact\TracingLink>
Inherited

Returns

array<mixed,\FeaturePhp\Artifact\TracingLink>

Internal function for generating the files for all registered artifacts.

_generateFiles() 
Inherited

Returns a chunk file from a chunk specification.

getExtendableFileFromSpecification(\FeaturePhp\Specification\ChunkSpecification $chunkSpecification) : \FeaturePhp\File\ChunkFile
inherited_from \FeaturePhp\Generator\ExtendGenerator::getExtendableFileFromSpecification()

Parameters

$chunkSpecification

\FeaturePhp\Specification\ChunkSpecification

Returns

\FeaturePhp\File\ChunkFile

Returns an extendable file from a specification.

getExtendableFileFromSpecification(\FeaturePhp\Specification\Specification $specification) : \FeaturePhp\File\ExtendableFile
Inherited

Parameters

$specification

\FeaturePhp\Specification\Specification

Returns

\FeaturePhp\File\ExtendableFile

Returns a chunk specification from a plain settings array.

getSpecification(array $file, \FeaturePhp\Generator\Settings $settings, \FeaturePhp\Artifact\Artifact $artifact) : \FeaturePhp\Specification\ChunkSpecification
inherited_from \FeaturePhp\Generator\ExtendGenerator::getSpecification()

Parameters

$file

array

a plain settings array

$settings

\FeaturePhp\Generator\Settings

the generator's settings

$artifact

\FeaturePhp\Artifact\Artifact

the currently processed artifact

Returns

\FeaturePhp\Specification\ChunkSpecification

Returns a specification from a plain settings array.

getSpecification(array $file, \FeaturePhp\Generator\Settings $settings, \FeaturePhp\Artifact\Artifact $artifact) : \FeaturePhp\Specification\Specification
Inherited

Parameters

$file

array

a plain settings array

$settings

\FeaturePhp\Generator\Settings

the generator's settings

$artifact

\FeaturePhp\Artifact\Artifact

the currently processed artifact

Returns

\FeaturePhp\Specification\Specification

Returns whether a feature's artifact is selected.

isSelectedFeature(string $featureName) : boolean
Inherited

Parameters

$featureName

string

Returns

boolean

Generates the extendable files for a set of artifacts and file settings.

generateFilesForArtifacts(array<mixed,\FeaturePhp\Artifact\Artifact> $artifacts, callable $fileSettingsGetter, boolean $extend) 
Inherited

Parameters

$artifacts

array<mixed,\FeaturePhp\Artifact\Artifact>

$fileSettingsGetter

callable

$extend

boolean

Creates an extendable file from a specification.

getExtendableFile(\FeaturePhp\Specification\Specification $specification) : \FeaturePhp\File\ExtendableFile
Inherited

If the extendable file was already created, returns the cached extendable file. If the extendable file does not yet exist, create it if it may be created from this specification.

Parameters

$specification

\FeaturePhp\Specification\Specification

Returns

\FeaturePhp\File\ExtendableFile

Returns plain settings arrays with file specifications for all registered artifacts.

getFileSettings(\FeaturePhp\Generator\Settings $settings) : array<mixed,array>
Inherited

Parameters

$settings

\FeaturePhp\Generator\Settings

Returns

array<mixed,array>

Returns plain settings arrays with file specifications for deselected artifacts.

getFileSettingsForDeselected(\FeaturePhp\Generator\Settings $settings) : array<mixed,array>
Inherited

Parameters

$settings

\FeaturePhp\Generator\Settings

Returns

array<mixed,array>

Returns plain settings arrays with file specifications for selected artifacts.

getFileSettingsForSelected(\FeaturePhp\Generator\Settings $settings) : array<mixed,array>
Inherited

Parameters

$settings

\FeaturePhp\Generator\Settings

Returns

array<mixed,array>

Returns the class names of all generators.

getGenerators() : array<mixed,string>
InheritedStatic

Returns

array<mixed,string>

 Properties

 

artifacts with a corresponding deselected feature that specify this generator

$deselectedArtifacts : array<mixed,\FeaturePhp\Artifact\Artifact>

Default

 

cached files generated by this generator

$files : array<mixed,\FeaturePhp\File\File>

Default

 

the log file for this generator

$logFile : \FeaturePhp\File\LogFile

Default

 

artifacts with a corresponding selected feature that specify this generator

$selectedArtifacts : array<mixed,\FeaturePhp\Artifact\Artifact>

Default

 

the settings object with generator settings

$settings : \FeaturePhp\Generator\Settings

Default

   

cached extendable files

$extendableFiles : array<mixed,\FeaturePhp\File\ExtendableFile>

Default