Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function profile(Request $request, ORMInterface $orm): Response |
||
34 | { |
||
35 | $userRepo = $orm->getRepository(User::class); |
||
36 | $login = $request->getAttribute('login', null); |
||
37 | |||
38 | $item = $userRepo->findByLogin($login); |
||
|
|||
39 | if ($item === null) { |
||
40 | return $this->responseFactory->createResponse(404); |
||
41 | } |
||
42 | |||
43 | $data = [ |
||
44 | 'item' => $item, |
||
45 | ]; |
||
46 | $response = $this->responseFactory->createResponse(); |
||
47 | |||
48 | $output = $this->render('profile', $data); |
||
49 | $response->getBody()->write($output); |
||
50 | |||
51 | return $response; |
||
52 | } |
||
54 |