| Total Complexity | 6 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 19 | final class Node implements HasDotRepresentation |
||
| 20 | { |
||
| 21 | 40 | public function __construct(private readonly Definition $definition) |
|
|
|
|||
| 22 | { |
||
| 23 | } |
||
| 24 | |||
| 25 | 24 | public function definition(): Definition |
|
| 26 | { |
||
| 27 | 24 | return $this->definition; |
|
| 28 | } |
||
| 29 | |||
| 30 | 24 | public function dotTemplate(): string |
|
| 31 | { |
||
| 32 | 24 | return 'node'; |
|
| 33 | } |
||
| 34 | |||
| 35 | 23 | public function labelTemplate(): string |
|
| 36 | { |
||
| 37 | 23 | if ($this->definition instanceof ClassDefinition) { |
|
| 38 | 20 | return 'class'; |
|
| 39 | } |
||
| 40 | 13 | if ($this->definition instanceof InterfaceDefinition) { |
|
| 41 | 11 | return 'interface'; |
|
| 42 | } |
||
| 43 | 10 | return 'trait'; |
|
| 44 | } |
||
| 46 |