Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
88.89% |
8 / 9 |
|
66.67% |
2 / 3 |
CRAP | |
0.00% |
0 / 1 |
| InterfaceSymbol | |
88.89% |
8 / 9 |
|
66.67% |
2 / 3 |
3.01 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getExtends | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getAutoloadAliasArray | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BrianHenryIE\Strauss\Types; |
| 4 | |
| 5 | use BrianHenryIE\Strauss\Files\File; |
| 6 | |
| 7 | class InterfaceSymbol extends DiscoveredSymbol implements AutoloadAliasInterface |
| 8 | { |
| 9 | protected array $extends; |
| 10 | |
| 11 | public function __construct( |
| 12 | string $fqdnClassname, |
| 13 | File $sourceFile, |
| 14 | ?string $namespace = null, |
| 15 | ?array $extends = null |
| 16 | ) { |
| 17 | parent::__construct($fqdnClassname, $sourceFile, $namespace); |
| 18 | |
| 19 | $this->extends = (array) $extends; |
| 20 | } |
| 21 | |
| 22 | public function getExtends(): array |
| 23 | { |
| 24 | return $this->extends; |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * @return array{type:string,interfacename:string,namespace:string,extends:array<string>} |
| 29 | */ |
| 30 | public function getAutoloadAliasArray(): array |
| 31 | { |
| 32 | return array ( |
| 33 | 'type' => 'interface', |
| 34 | 'interfacename' => $this->getOriginalLocalName(), |
| 35 | 'namespace' => $this->namespace, |
| 36 | 'extends' => [$this->getReplacement()] + $this->extends, |
| 37 | ); |
| 38 | } |
| 39 | } |