| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2.032 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | 20 | public function getSpacecraftSystem(SpacecraftSystemTypeEnum $type): SpacecraftSystemInterface |
|
| 23 | { |
||
| 24 | 20 | $system = $this->getThis()->getSystems()->get($type->value); |
|
| 25 | 20 | if ($system === null) { |
|
| 26 | throw new InvalidSystemException(sprintf('system type %d does not exist on ship', $type->value)); |
||
| 27 | } |
||
| 28 | |||
| 29 | 20 | return $system; |
|
| 30 | } |
||
| 32 |