| Conditions | 7 |
| Paths | 9 |
| Total Lines | 21 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 56 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function handle(GameControllerInterface $game): void |
||
| 27 | { |
||
| 28 | $user = $game->getUser(); |
||
| 29 | |||
| 30 | if ((int) $user->getState() !== UserEnum::USER_STATE_TUTORIAL2 || (int) $user->getState() !== UserEnum::USER_STATE_TUTORIAL3 || (int) $user->getState() !== UserEnum::USER_STATE_TUTORIAL4) { |
||
| 31 | throw new AccessViolation(); |
||
| 32 | } |
||
| 33 | |||
| 34 | if ((int) $user->getState() === UserEnum::USER_STATE_TUTORIAL2) { |
||
| 35 | $user->setState(UserEnum::USER_STATE_TUTORIAL1); |
||
| 36 | } |
||
| 37 | |||
| 38 | if ((int) $user->getState() === UserEnum::USER_STATE_TUTORIAL3) { |
||
| 39 | $user->setState(UserEnum::USER_STATE_TUTORIAL2); |
||
| 40 | } |
||
| 41 | |||
| 42 | if ((int) $user->getState() === UserEnum::USER_STATE_TUTORIAL4) { |
||
| 43 | $user->setState(UserEnum::USER_STATE_TUTORIAL3); |
||
| 44 | } |
||
| 45 | |||
| 46 | $this->userRepository->save($user); |
||
| 47 | } |
||
| 55 |