Generates a file with runtime information.
An artifact can register a runtime generator to provide information about its corresponding feature (selected or deselected) at runtime. If used, a suitable PHP class is generated according to the product line's generator settings (see \FeaturePhp\Generator\Settings). (Only PHP is supported as of now.)
package | Default |
---|---|
inherited_from | \FeaturePhp\Generator\Generator |
__construct(\FeaturePhp\Generator\Settings $settings)
inherited_from | \FeaturePhp\Generator\Generator::__construct() |
---|
\FeaturePhp\Generator\Settings
__construct(\FeaturePhp\Generator\Settings $settings)
\FeaturePhp\Generator\Settings
addDeselectedArtifact(\FeaturePhp\Artifact\Artifact $artifact)
\FeaturePhp\Artifact\Artifact
addSelectedArtifact(\FeaturePhp\Artifact\Artifact $artifact)
\FeaturePhp\Artifact\Artifact
generateFiles() : array<mixed,\FeaturePhp\File\File>
If the files have already been generated, returns the cached files. The generator's log file is included.
array<mixed,\FeaturePhp\File\File>
getGeneratorMap() : array<mixed,string>
array<mixed,string>
getKey() : string
The key is the name used to identify the \FeaturePhp\Generator\Settings for a generator.
inherited_from | \FeaturePhp\Generator\Generator::getKey() |
---|
string
getKey() : string
The key is the name used to identify the \FeaturePhp\Generator\Settings for a generator.
string
getRegisteredArtifacts() : array<mixed,\FeaturePhp\Artifact\Artifact>
array<mixed,\FeaturePhp\Artifact\Artifact>
getSettings() : \FeaturePhp\Generator\Settings
\FeaturePhp\Generator\Settings
hasArtifacts() : boolean
boolean
trace() : array<mixed,\FeaturePhp\Artifact\TracingLink>
array<mixed,\FeaturePhp\Artifact\TracingLink>
traceRuntimeCalls(array<mixed,\FeaturePhp\File\File> $files, \FeaturePhp\ProductLine\ProductLine $productLine) : array<mixed,\FeaturePhp\Artifact\TracingLink>
array<mixed,\FeaturePhp\File\File>
\FeaturePhp\ProductLine\ProductLine
array<mixed,\FeaturePhp\Artifact\TracingLink>
_generateFiles()
Internally, this uses a template file and assigns the given variables. You can override this to add runtime information for other languages. If a feature was supplied, only generates if that feature is selected.
inherited_from | \FeaturePhp\Generator\Generator::_generateFiles() |
---|
_generateFiles()
isSelectedFeature(string $featureName) : boolean
string
boolean
encodeFeatureNames(array<mixed,\FeaturePhp\Artifact\Artifact> $artifacts) : string
The JSON is assumed to then be enclosed in single quotes (').
array<mixed,\FeaturePhp\Artifact\Artifact>
string
getGenerators() : array<mixed,string>
array<mixed,string>
$deselectedArtifacts : array<mixed,\FeaturePhp\Artifact\Artifact>
$files : array<mixed,\FeaturePhp\File\File>
$logFile : \FeaturePhp\File\LogFile
$selectedArtifacts : array<mixed,\FeaturePhp\Artifact\Artifact>
$settings : \FeaturePhp\Generator\Settings
$tracingLinks : array<mixed,\FeaturePhp\Artifact\TracingLink>
$class : string
$feature : string | null
$getter : string
$target : string