Total Complexity | 7 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Coverage | 71.43% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | trait SpacecraftSystemHealthTrait |
||
8 | { |
||
9 | use SpacecraftTrait; |
||
10 | use HasSpacecraftSystemTrait; |
||
11 | |||
12 | 17 | public function isSystemHealthy(SpacecraftSystemTypeEnum $type): bool |
|
13 | { |
||
14 | 17 | if (!$this->hasSpacecraftSystem($type)) { |
|
15 | 14 | return false; |
|
16 | } |
||
17 | |||
18 | 5 | return $this->getSpacecraftSystem($type)->isHealthy(); |
|
19 | } |
||
20 | |||
21 | public function isDeflectorHealthy(): bool |
||
22 | { |
||
23 | return $this->isSystemHealthy(SpacecraftSystemTypeEnum::DEFLECTOR); |
||
24 | } |
||
25 | |||
26 | public function isMatrixScannerHealthy(): bool |
||
27 | { |
||
28 | return $this->isSystemHealthy(SpacecraftSystemTypeEnum::MATRIX_SCANNER); |
||
29 | } |
||
30 | |||
31 | 10 | public function isTorpedoStorageHealthy(): bool |
|
32 | { |
||
33 | 10 | return $this->isSystemHealthy(SpacecraftSystemTypeEnum::TORPEDO_STORAGE); |
|
34 | } |
||
35 | |||
36 | 1 | public function isShuttleRampHealthy(): bool |
|
39 | } |
||
40 | |||
41 | 1 | public function isWebEmitterHealthy(): bool |
|
44 | } |
||
45 | } |
||
46 |