A role defines a class' responsibilities in a collaboration.
As part of a \FeaturePhp\Collaboration\Collaboration, a role implements part of a feature's functionality. A role may be the base code for a class or a class refinement. Roles are composed using a \FeaturePhp\Collaboration\Composer.
package | Default |
---|
__construct(\FeaturePhp\Specification\FileSpecification $fileSpecification, \FeaturePhp\Collaboration\Collaboration $collaboration)
\FeaturePhp\Specification\FileSpecification
\FeaturePhp\Collaboration\Collaboration
correspondsTo(\FeaturePhp\Collaboration\Role $role) : boolean
It requires the roles' files to reside in the same containment hierarchies (i.e. their source paths match). This is an equivalence relation and can be used by \FeaturePhp\Helper\Partition.
\FeaturePhp\Collaboration\Role
boolean
getCollaboration() : \FeaturePhp\Collaboration\Collaboration
\FeaturePhp\Collaboration\Collaboration
getFileSpecification() : \FeaturePhp\Specification\FileSpecification
\FeaturePhp\Specification\FileSpecification
getKind() : string
This is used to determine the role's \Composer. As of now, the kind is simply the file extension.
string
$collaboration : \FeaturePhp\Collaboration\Collaboration
$fileSpecification : \FeaturePhp\Specification\FileSpecification