Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public function index(Request $request, ORMInterface $orm): Response |
||
19 | { |
||
20 | $postRepo = $orm->getRepository(Post::class); |
||
21 | $slug = $request->getAttribute('slug', null); |
||
22 | |||
23 | $item = $postRepo->fullPostPage($slug, $this->user->getId()); |
||
|
|||
24 | if ($item === null) { |
||
25 | return $this->responseFactory->createResponse(404); |
||
26 | } |
||
27 | |||
28 | $data = [ |
||
29 | 'item' => $item, |
||
30 | ]; |
||
31 | $output = $this->render(__FUNCTION__, $data); |
||
32 | |||
33 | $response = $this->responseFactory->createResponse(); |
||
34 | $response->getBody()->write($output); |
||
35 | return $response; |
||
36 | } |
||
38 |