| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | public function handle(ServerRequestInterface $request): ResponseInterface |
||
| 38 | { |
||
| 39 | $id = (int) $request->getAttribute('id'); |
||
| 40 | $user = $this->userRepository->find($id); |
||
| 41 | if (!$user) { |
||
| 42 | $this->logger->warning('Can not find user with id {id}', ['id' => $id]); |
||
| 43 | |||
| 44 | return (new RedirectResponse('../list'))->redirect(); |
||
| 45 | } |
||
| 46 | |||
| 47 | return new TemplateResponse( |
||
| 48 | $this->template, |
||
| 49 | 'detail', |
||
| 50 | [ |
||
| 51 | 'user' => $user, |
||
| 52 | ] |
||
| 56 |