An aspect implements a crosscutting concern.

Similar to a \FeaturePhp\Collaboration\Role in collaboration-based design, an aspect implements part of a feature's functionality. Typically, this functionality concerns many other features (crosscutting concerns, e.g. Logging, Cache, Encryption ...). An aspect encapsulates this behaviour using pointcuts and advices. All aspects are registered in a \FeaturePhp\Aspect\AspectKernel.

package Default

 Methods

Creates an aspect.

__construct(\FeaturePhp\Artifact\Artifact $artifact, \FeaturePhp\Specification\FileSpecification $fileSpecification) 

Parameters

$artifact

\FeaturePhp\Artifact\Artifact

$fileSpecification

\FeaturePhp\Specification\FileSpecification

Returns the aspect's corresponding artifact.

getArtifact() : \FeaturePhp\Artifact\Artifact

Returns

\FeaturePhp\Artifact\Artifact

Returns the aspect's class name.

getClassName() : string

For this, the aspect's file has to be parsed.

Returns

string

Returns which file the aspect refers to.

getFileSpecification() : \FeaturePhp\Specification\FileSpecification

Returns

\FeaturePhp\Specification\FileSpecification

Returns the path of the aspect's target file relative to the aspect kernel's target file.

getRelativeFileTarget(string $aspectKernelTarget) : string

Parameters

$aspectKernelTarget

string

Returns

string

Returns the aspect's stored file.

getStoredFile() : \FeaturePhp\File\StoredFile

Returns

\FeaturePhp\File\StoredFile

 Properties

 

the aspect's corresponding artifact

$artifact : \FeaturePhp\Artifact\Artifact

Default

 

which file the aspect refers to

$fileSpecification : \FeaturePhp\Specification\FileSpecification

Default