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