| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function handleShipDestruction( |
||
| 20 | ?ShipDestroyerInterface $destroyer, |
||
| 21 | ShipWrapperInterface $destroyedShipWrapper, |
||
| 22 | ShipDestructionCauseEnum $cause, |
||
| 23 | InformationInterface $informations |
||
| 24 | ): void { |
||
| 25 | |||
| 26 | $user = $destroyedShipWrapper->get()->getUser(); |
||
| 27 | |||
| 28 | if ($user->getState() === UserEnum::USER_STATE_COLONIZATION_SHIP) { |
||
| 29 | $user->setState(UserEnum::USER_STATE_UNCOLONIZED); |
||
| 30 | $this->userRepository->save($user); |
||
| 31 | } |
||
| 34 |