Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
39 | public function usersAction() |
||
40 | { |
||
41 | $id = $this->getParam('id'); |
||
42 | /** @var UserService $userSvc */ |
||
43 | $userSvc = ContainerService::getInstance()->getContainer()['service.user']; |
||
44 | /** @var User $user */ |
||
45 | $user = $userSvc->findUserById($id); |
||
46 | if (!$user) { |
||
47 | $this->sendJsonResponse(['User not found']); |
||
48 | } |
||
49 | $this->sendJsonResponse(['email' => $user->getEmail()]); |
||
50 | } |
||
51 | } |
||
52 |