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