Conditions | 3 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.2098 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | 1 | public function index(Request $request, CommentService $service): Response |
|
22 | { |
||
23 | 1 | $paginator = $service->getFeedPaginator(); |
|
24 | 1 | if ($request->getAttribute('next') !== null) { |
|
25 | $paginator = $paginator->withNextPageToken((string)$request->getAttribute('next')); |
||
26 | } |
||
27 | |||
28 | 1 | if ($this->isAjaxRequest($request)) { |
|
29 | return $this->viewRenderer->renderPartial('_comments', ['data' => $paginator]); |
||
30 | } |
||
31 | |||
32 | 1 | return $this->viewRenderer->render('index', ['data' => $paginator]); |
|
33 | } |
||
40 |