| Total Complexity | 9 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 72.21% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class SpacecraftSystemWrapper |
||
| 9 | { |
||
| 10 | private SpacecraftSystem $spacecraftSystem; |
||
| 11 | |||
| 12 | 1 | public function __construct( |
|
| 13 | Spacecraft $spacecraft, |
||
| 14 | private SpacecraftSystemTypeEnum $type |
||
| 15 | ) { |
||
| 16 | 1 | $this->spacecraftSystem = $spacecraft->getSpacecraftSystem($type); |
|
| 17 | } |
||
| 18 | |||
| 19 | public function get(): SpacecraftSystem |
||
| 22 | } |
||
| 23 | |||
| 24 | 1 | public function isActivated(): bool |
|
| 25 | { |
||
| 26 | 1 | return $this->spacecraftSystem->getMode()->isActivated(); |
|
| 27 | } |
||
| 28 | |||
| 29 | public function isHealthy(): bool |
||
| 30 | { |
||
| 31 | return $this->spacecraftSystem->isHealthy(); |
||
| 32 | } |
||
| 33 | |||
| 34 | 1 | public function getGenericTemplate(): ?string |
|
| 37 | } |
||
| 38 | |||
| 39 | 1 | public function getIcon(): string |
|
| 40 | { |
||
| 41 | 1 | return $this->type->getIcon(); |
|
| 42 | } |
||
| 43 | |||
| 44 | 1 | public function getDescription(): string |
|
| 47 | } |
||
| 48 | |||
| 49 | 1 | public function getPreActionJs(): ?string |
|
| 50 | { |
||
| 51 | 1 | return $this->type->isReloadOnActivation() |
|
| 56 |