| Conditions | 1 |
| Paths | 1 |
| Total Lines | 32 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 11 | public function __invoke(ServerRequestInterface &$request, ResponseInterface $response) |
||
| 12 | { |
||
| 13 | $template = 'blog-list'; |
||
| 14 | $data = [ |
||
| 15 | 'blogPosts' => [ |
||
| 16 | [ |
||
| 17 | 'title' => 'Fake test 1', |
||
| 18 | 'slug' => 'fake_1', |
||
| 19 | 'publishedAt' => time(), |
||
| 20 | 'author' => [ |
||
| 21 | 'name' => 'John Doe' |
||
| 22 | ], |
||
| 23 | 'content' => 'Lorem ipsum dolor sit amet...' |
||
| 24 | ], |
||
| 25 | [ |
||
| 26 | 'title' => 'Fake test 2', |
||
| 27 | 'slug' => 'fake_2', |
||
| 28 | 'publishedAt' => time(), |
||
| 29 | 'author' => [ |
||
| 30 | 'name' => 'Jane Doe' |
||
| 31 | ], |
||
| 32 | 'content' => 'Lorem ipsum dolor sit amet...' |
||
| 33 | ] |
||
| 34 | ] |
||
| 35 | ]; |
||
| 36 | |||
| 37 | $request = $request |
||
| 38 | ->withAttribute('template', $template) |
||
| 39 | ->withAttribute('data', $data); |
||
| 40 | |||
| 41 | return $response; |
||
| 42 | } |
||
| 43 | } |
||
| 44 |