Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
34 | public function profile(ServerRequestInterface $request, UserRepository $userRepository): ResponseInterface |
||
35 | { |
||
36 | $login = $request->getAttribute('login', null); |
||
37 | |||
38 | /** @var User $user */ |
||
39 | $user = $userRepository->findByLogin($login); |
||
40 | if ($user === null) { |
||
41 | return $this->responseFactory->createResponse('Page not found', 404); |
||
42 | } |
||
43 | |||
44 | return $this->responseFactory->createResponse( |
||
45 | ['login' => $user->getLogin(), 'created_at' => $user->getCreatedAt()->format('H:i:s d.m.Y')] |
||
46 | ); |
||
49 |