| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 1 | protected function run( |
|
| 30 | ServerRequestInterface $request, |
||
| 31 | ResponseInterface $response, |
||
| 32 | array $args |
||
| 33 | ): ResponseInterface { |
||
| 34 | 1 | $body = $this->schemaValidator->getValidatedBody( |
|
| 35 | 1 | $request, |
|
| 36 | 1 | 'UserSettings.json', |
|
| 37 | ); |
||
| 38 | |||
| 39 | /** @var UserInterface $user */ |
||
| 40 | 1 | $user = $request->getAttribute(SessionValidatorMiddleware::USER); |
|
| 41 | |||
| 42 | 1 | $user->setLanguage($body['language']); |
|
| 43 | |||
| 44 | 1 | $this->userRepository->save($user); |
|
| 45 | |||
| 46 | 1 | return $this->asJson( |
|
| 47 | 1 | $response, |
|
| 48 | [ |
||
| 49 | 1 | 'result' => true |
|
| 50 | ] |
||
| 54 |