Generates a product's files.

A generator is used to automatically generate files for every registered \FeaturePhp\Artifact\Artifact of a \FeaturePhp\ProductLine\Product.

package Default

 Methods

Creates a generator.

__construct(\FeaturePhp\Generator\Settings $settings) 

Parameters

$settings

\FeaturePhp\Generator\Settings

Registers an artifact whose corresponding feature is deselected.

addDeselectedArtifact(\FeaturePhp\Artifact\Artifact $artifact) 

Parameters

$artifact

\FeaturePhp\Artifact\Artifact

Registers an artifact whose corresponding feature is selected.

addSelectedArtifact(\FeaturePhp\Artifact\Artifact $artifact) 

Parameters

$artifact

\FeaturePhp\Artifact\Artifact

Generates the files for all registered artifacts.

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

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>
Static

Returns

array<mixed,string>

Returns the generator's key.

getKey() : string
Static

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>

Returns

array<mixed,\FeaturePhp\Artifact\Artifact>

Returns the generator's settings.

getSettings() : \FeaturePhp\Generator\Settings

Returns

\FeaturePhp\Generator\Settings

Returns whether any artifacts are registered with the generator.

hasArtifacts() : boolean

Returns

boolean

Returns tracing links for all registered artifacts.

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

Returns

array<mixed,\FeaturePhp\Artifact\TracingLink>

Internal function for generating the files for all registered artifacts.

_generateFiles() 

Returns whether a feature's artifact is selected.

isSelectedFeature(string $featureName) : boolean

Parameters

$featureName

string

Returns

boolean

Returns the class names of all generators.

getGenerators() : array<mixed,string>
Static

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