Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 1 | public function create(PaginatorInterface $paginator): ResponseInterface |
|
21 | { |
||
22 | 1 | $response = []; |
|
23 | 1 | foreach ($paginator->read() as $post) { |
|
24 | 1 | $response[] = new Response( |
|
25 | 1 | $post->getId(), |
|
26 | 1 | $post->getTitle(), |
|
27 | 1 | $post->getContent(), |
|
28 | ); |
||
29 | } |
||
30 | |||
31 | 1 | return $this->responseFactory->createResponse([ |
|
32 | 1 | 'posts' => $response, |
|
33 | 1 | 'paginator' => $this->paginatorFormatter->format($paginator), |
|
34 | ]); |
||
37 |