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\ComposergetComposerMap() : array<mixed,string>
array<mixed,string>getContent() : \FeaturePhp\File\TextFileContent
| inherited_from | \FeaturePhp\Collaboration\Composer::getContent() |
|---|
\FeaturePhp\File\TextFileContentgetContent() : \FeaturePhp\File\FileContent
\FeaturePhp\File\FileContentgetKind() : string
| inherited_from | \FeaturePhp\Collaboration\Composer::getKind() |
|---|
stringgetKind() : string
stringrefine(\FeaturePhp\Collaboration\Role $role) : \FeaturePhp\Collaboration\ClassComposer
| inherited_from | \FeaturePhp\Collaboration\Composer::refine() |
|---|
\FeaturePhp\Collaboration\Role
\FeaturePhp\Collaboration\ClassComposerrefine(\FeaturePhp\Collaboration\Role $role) : \FeaturePhp\Collaboration\Composer
\FeaturePhp\Collaboration\Role
\FeaturePhp\Collaboration\ComposerextendClass(\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
stringmangleClassName(\PhpParser\Node\Stmt\Class_ $class, \FeaturePhp\Collaboration\Role $role)
\PhpParser\Node\Stmt\Class_
\FeaturePhp\Collaboration\Role
$ast : array<mixed,array>
$parentClass : string
$targetClass : string