A collaboration is a set of cooperating roles.

A collaboration consists of all roles (\FeaturePhp\Collaboration\Role) needed to implement a feature. As such, it corresponds to a \FeaturePhp\Artifact\Artifact (every artifact may have exactly one collaboration).

package Default

 Methods

Creates a collaboration.

__construct(\FeaturePhp\Artifact\Artifact $artifact) 

Parameters

$artifact

\FeaturePhp\Artifact\Artifact

Adds a role to a collaboration.

addRoleFromFileSpecification(\FeaturePhp\Specification\FileSpecification $fileSpecification) 

This is expected to be called only be a \FeaturePhp\Generator\CollaborationGenerator.

Parameters

$fileSpecification

\FeaturePhp\Specification\FileSpecification

Finds a collaboration by its artifact in a list of collaborations.

findByArtifact(array<mixed,\FeaturePhp\Collaboration\Collaboration> $collaborations, \FeaturePhp\Artifact\Artifact $artifact) : \FeaturePhp\Collaboration\Collaboration
Static

Parameters

$collaborations

array<mixed,\FeaturePhp\Collaboration\Collaboration>

$artifact

\FeaturePhp\Artifact\Artifact

Returns

\FeaturePhp\Collaboration\Collaboration

Returns the collaboration's corresponding artifact.

getArtifact() : \FeaturePhp\Artifact\Artifact

Returns

\FeaturePhp\Artifact\Artifact

Returns the collaboration's roles.

getRoles() : array<mixed,\FeaturePhp\Collaboration\Role>

Returns

array<mixed,\FeaturePhp\Collaboration\Role>

 Properties

 

the collaboration's corresponding artifact

$artifact : \FeaturePhp\Artifact\Artifact

Default

 

the collaboration's roles

$roles : array<mixed,\FeaturePhp\Collaboration\Role>

Default