A product of a software product line.

A product is a concrete variant of a \FeaturePhp\ProductLine\ProductLine. Its \FeaturePhp\Model\Configuration defines which features are selected and deselected. A product can be analyzed, generated (or derived) and exported automatically.

package Default

 Methods

Creates a product.

__construct(\FeaturePhp\ProductLine\ProductLine $productLine, \FeaturePhp\Model\Configuration $configuration, boolean $allowInvalid = false

Throws \FeaturePhp\ProductLine\ProductException if the configuration is invalid.

Parameters

$productLine

\FeaturePhp\ProductLine\ProductLine

$configuration

\FeaturePhp\Model\Configuration

$allowInvalid

boolean

whether to throw an exception if the configuration is invalid

Exports the product using an exporter.

export(\FeaturePhp\Exporter\Exporter $exporter) 

Depending on the exporter, this has a side effect, e.g. downloading a file.

Parameters

$exporter

\FeaturePhp\Exporter\Exporter

Generates the product's files.

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

Returns

array<mixed,\FeaturePhp\File\File>

Returns the product's configuration.

getConfiguration() : \FeaturePhp\Model\Configuration

Returns

\FeaturePhp\Model\Configuration

Returns the product's product line.

getProductLine() : \FeaturePhp\ProductLine\ProductLine

Returns

\FeaturePhp\ProductLine\ProductLine

Analyzes the product by returning a web page.

renderAnalysis(boolean $textOnly = false) : string

Parameters

$textOnly

boolean

whether to render text or HTML

Returns

string

Returns tracing links for the product.

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

Returns

array<mixed,\FeaturePhp\Artifact\TracingLink>

Adds a feature's artifact to all generators it specifies.

addArtifactToUsedGenerators(array<mixed,\FeaturePhp\Generator\Generator> $allGenerators, \FeaturePhp\Model\Feature $feature, callable $func) 

This is done independently from whether the corresponding feature is selected or deselected to support generating code for both cases.

Parameters

$allGenerators

array<mixed,\FeaturePhp\Generator\Generator>

$feature

\FeaturePhp\Model\Feature

$func

callable

whether to add a selected or deselected artifact

Returns all generators.

getAllGenerators() : array<mixed,\FeaturePhp\Generator\Generator>

The generators are instantiated with their respective generator settings.

Returns

array<mixed,\FeaturePhp\Generator\Generator>

Returns elements generated for the product.

getGeneratorElements(callable $func) : array<mixed,mixed>

To do this, every artifact is registered with the generators it specifies. Then every generator generates some elements. Finally all the elements are merged.

Parameters

$func

callable

Returns

array<mixed,mixed>

 Properties

 

the product's configuration

$configuration : \FeaturePhp\Model\Configuration

Default

 

the product line that this product derives

$productLine : \FeaturePhp\ProductLine\ProductLine

Default