| Conditions | 6 |
| Paths | 6 |
| Total Lines | 16 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 42 |
| Changes | 7 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php |
||
| 25 | public function handle(GameControllerInterface $game): void |
||
| 26 | { |
||
| 27 | $user = $game->getUser(); |
||
| 28 | |||
| 29 | if (!$user->hasColony()) { |
||
| 30 | throw new AccessViolation(); |
||
| 31 | } elseif ($user->getState() === UserEnum::USER_STATE_TUTORIAL1) { |
||
| 32 | $user->setState(UserEnum::USER_STATE_TUTORIAL2); |
||
| 33 | } elseif ($user->getState() === UserEnum::USER_STATE_TUTORIAL2) { |
||
| 34 | $user->setState(UserEnum::USER_STATE_TUTORIAL3); |
||
| 35 | } elseif ($user->getState() === UserEnum::USER_STATE_TUTORIAL3) { |
||
| 36 | $user->setState(UserEnum::USER_STATE_TUTORIAL4); |
||
| 37 | } elseif ($user->getState() === UserEnum::USER_STATE_TUTORIAL4) { |
||
| 38 | $user->setState(UserEnum::USER_STATE_ACTIVE); |
||
| 39 | } |
||
| 40 | $this->userRepository->save($user); |
||
| 41 | } |
||
| 49 |