Registers aspects in an aspect kernel.

This generator implements the idea of aspect-oriented programming outlined in Chapter 6 of "Feature-Oriented Software Product Lines" (see http://www.springer.com/de/book/9783642375200). A feature can supply some aspects (see \FeaturePhp\Aspect\Aspect) which serve the modularization of crosscutting concerns. An aspect can intercept different kinds of events in the control flow (called pointcuts). Aspects are implemented using the Go! AOP framework (see https://github.com/goaop/framework) which is a mature AOP framework for PHP development. All aspects from selected features are registered in a \FeaturePhp\Aspect\AspectKernel which is then available for use in the generated product.

package Default
inherited_from \FeaturePhp\Generator\FileGenerator

 Methods

Creates an aspect generator.

__construct(\FeaturePhp\Generator\Settings $settings) 
inherited_from \FeaturePhp\Generator\FileGenerator::__construct()

Parameters

$settings

\FeaturePhp\Generator\Settings

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

Generates the aspect files and the aspect kernel.

_generateFiles() 
inherited_from \FeaturePhp\Generator\FileGenerator::_generateFiles()

Internal function for generating the files for all registered artifacts.

_generateFiles() 
Inherited

Returns whether a feature's artifact is selected.

isSelectedFeature(string $featureName) : boolean
Inherited

Parameters

$featureName

string

Returns

boolean

Adds an aspect from a file to the aspect kernel.

processFileSpecification(\FeaturePhp\Artifact\Artifact $artifact, \FeaturePhp\Specification\FileSpecification $fileSpecification) 
inherited_from \FeaturePhp\Generator\FileGenerator::processFileSpecification()

Parameters

$artifact

\FeaturePhp\Artifact\Artifact

$fileSpecification

\FeaturePhp\Specification\FileSpecification

Processes a file from a specification.

processFileSpecification(\FeaturePhp\Artifact\Artifact $artifact, \FeaturePhp\Specification\FileSpecification $fileSpecification) 
Inherited

Parameters

$artifact

\FeaturePhp\Artifact\Artifact

$fileSpecification

\FeaturePhp\Specification\FileSpecification

Processes a file from a specification.

_processFileSpecification(\FeaturePhp\Artifact\Artifact $artifact, \FeaturePhp\Specification\FileSpecification $fileSpecification) 
Inherited

Considers globally excluded files. Only exact file names are supported.

Parameters

$artifact

\FeaturePhp\Artifact\Artifact

$fileSpecification

\FeaturePhp\Specification\FileSpecification

Returns plain settings arrays with file or directory specifications.

getFileOrDirectorySettings(\FeaturePhp\Generator\Settings $settings, string $key) : array<mixed,array>
Inherited

Parameters

$settings

\FeaturePhp\Generator\Settings

$key

string

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

   

the application aspect kernel

$aspectKernel : \FeaturePhp\Aspect\AspectKernel

Default

 

the aspect kernel name, defaults to "ApplicationAspectKernel"

$class : string

Default

 

list of globally excluded files

$exclude : array<mixed,string>

Default

 

a feature that has to be selected to generate the aspect kernel

$feature : string | null

Default

 

the aspect kernel file target in the generated product, defaults to "AspectKernel.php"

$target : string

Default