| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | 4 | public function __invoke( |
|
| 16 | 4 | Request $request, |
|
| 17 | 3 | Response $response, |
|
| 18 | array $args |
||
| 19 | 1 | ): Response { |
|
| 20 | $input = (array) $request->getParsedBody(); |
||
| 21 | $id = (int) $args['id']; |
||
| 22 | $userIdLogged = $this->getAndValidateUserId($input); |
||
| 23 | $this->checkUserPermissions($id, $userIdLogged); |
||
| 24 | $user = $this->getServiceUpdateUser()->update($input, $id); |
||
| 25 | |||
| 26 | return $this->jsonResponse($response, 'success', $user, 200); |
||
| 27 | } |
||
| 29 |