Composes roles that refine PHP classes.
There are two sensible ways to implement this kind of composer: mixin-based inheritance and superimposition. Here, we implement the former because of its relative simplicity (though it has runtime overhead).
package | Default |
---|---|
inherited_from | \FeaturePhp\Collaboration\Composer |
__construct(string $targetClass= null
, string $parentClass= null
, array<mixed,array> $ast= array()
)
string
string
array<mixed,array>
fromKind(string $kind) : \FeaturePhp\Collaboration\Composer
string
\FeaturePhp\Collaboration\Composer
getComposerMap() : array<mixed,string>
array<mixed,string>
getContent() : \FeaturePhp\File\TextFileContent
inherited_from | \FeaturePhp\Collaboration\Composer::getContent() |
---|
\FeaturePhp\File\TextFileContent
getContent() : \FeaturePhp\File\FileContent
\FeaturePhp\File\FileContent
getKind() : string
inherited_from | \FeaturePhp\Collaboration\Composer::getKind() |
---|
string
getKind() : string
string
refine(\FeaturePhp\Collaboration\Role $role) : \FeaturePhp\Collaboration\ClassComposer
inherited_from | \FeaturePhp\Collaboration\Composer::refine() |
---|
\FeaturePhp\Collaboration\Role
\FeaturePhp\Collaboration\ClassComposer
refine(\FeaturePhp\Collaboration\Role $role) : \FeaturePhp\Collaboration\Composer
\FeaturePhp\Collaboration\Role
\FeaturePhp\Collaboration\Composer
extendClass(\PhpParser\Node\Stmt\Class_ $class)
\PhpParser\Node\Stmt\Class_
getComposers() : array<mixed,string>
array<mixed,string>
getMangledClassName(\FeaturePhp\Collaboration\Role $role) : string
The mangled class name encodes the corresponding feature identifier, this facilitates debugging.
\FeaturePhp\Collaboration\Role
string
mangleClassName(\PhpParser\Node\Stmt\Class_ $class, \FeaturePhp\Collaboration\Role $role)
\PhpParser\Node\Stmt\Class_
\FeaturePhp\Collaboration\Role
$ast : array<mixed,array>
$parentClass : string
$targetClass : string