Conditions | 3 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 3 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
14 | 3 | public function update(array $input, int $userId): object |
|
15 | 3 | { |
|
16 | 1 | $data = $this->validateUserData($input, $userId); |
|
17 | /** @var User $user */ |
||
18 | 2 | $user = $this->userRepository->update($data); |
|
19 | 2 | ||
20 | if (self::isRedisEnabled() === true) { |
||
21 | 1 | $this->saveInCache($user->getId(), $user->toJson()); |
|
22 | 1 | } |
|
23 | if (self::isLoggerEnabled() === true) { |
||
24 | 1 | $this->loggerService->setInfo('The user with the ID ' . $user->getId() . ' has updated successfully.'); |
|
25 | 1 | } |
|
26 | |||
27 | 1 | return $user->toJson(); |
|
28 | } |
||
52 |