| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | 2 | protected function serve( |
|
| 34 | ServerRequestInterface $request, |
||
| 35 | JsonEnabledResponseInterface $response, |
||
| 36 | array $args |
||
| 37 | ): ResponseInterface { |
||
| 38 | 2 | $user = $this->userRepository->find((int) ($args['userId'] ?? 0)); |
|
| 39 | |||
| 40 | 2 | if ($user === null) { |
|
| 41 | 1 | return $response->withStatus(Http::NOT_FOUND); |
|
| 42 | } |
||
| 43 | |||
| 44 | 1 | return $response->withJson( |
|
| 45 | 1 | $this->resultItemFactory->createUserListItem($user) |
|
| 46 | 1 | ); |
|
| 49 |