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