| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | private function getUser(EventInterface $event): UserInterface |
||
| 38 | { |
||
| 39 | /** @var PayloadWithIdAndTurn */ |
||
| 40 | $payload = $event->getPayloadAsObject($this->jsonMapper); |
||
| 41 | |||
| 42 | $user = $this->userRepository->find($payload->id); |
||
| 43 | if ($user === null) { |
||
| 44 | throw new RuntimeException(sprintf('userId %d does not exist', $payload->id)); |
||
| 45 | } |
||
| 46 | |||
| 47 | return $user; |
||
| 48 | } |
||
| 50 |