Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
57 | 2 | public function __invoke( |
|
58 | CurrentRoute $currentRoute, |
||
59 | UserRepository $userRepository, |
||
60 | ResponseFactory $responseFactory, |
||
61 | ): ResponseInterface { |
||
62 | /** |
||
63 | * @var User $user |
||
64 | */ |
||
65 | 2 | $user = $userRepository->findByPK($currentRoute->getArgument('id')); |
|
66 | 2 | if ($user === null) { |
|
67 | 1 | throw new NotFoundException(); |
|
68 | } |
||
69 | |||
70 | 1 | return $responseFactory->create($user); |
|
71 | } |
||
73 |