| Conditions | 1 |
| Paths | 1 |
| Total Lines | 35 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 3 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 21 | public function __invoke(ServerRequestInterface &$request, ResponseInterface $response) |
||
| 22 | { |
||
| 23 | /** @var UserEntity $userEntity */ |
||
| 24 | $userEntity = $this->userStorage->getUserById(1); |
||
| 25 | |||
| 26 | $template = 'blog-list'; |
||
| 27 | $data = [ |
||
| 28 | 'blogPosts' => [ |
||
| 29 | [ |
||
| 30 | 'title' => 'Fake test 1', |
||
| 31 | 'slug' => 'fake_1', |
||
| 32 | 'publishedAt' => time(), |
||
| 33 | 'author' => [ |
||
| 34 | 'name' => $userEntity->getUserName() |
||
| 35 | ], |
||
| 36 | 'content' => 'Lorem ipsum dolor sit amet...' |
||
| 37 | ], |
||
| 38 | [ |
||
| 39 | 'title' => 'Fake test 2', |
||
| 40 | 'slug' => 'fake_2', |
||
| 41 | 'publishedAt' => time(), |
||
| 42 | 'author' => [ |
||
| 43 | 'name' => 'Jane Doe' |
||
| 44 | ], |
||
| 45 | 'content' => 'Lorem ipsum dolor sit amet...' |
||
| 46 | ] |
||
| 47 | ] |
||
| 48 | ]; |
||
| 49 | |||
| 50 | $request = $request |
||
| 51 | ->withAttribute('template', $template) |
||
| 52 | ->withAttribute('data', $data); |
||
| 53 | |||
| 54 | return $response; |
||
| 55 | } |
||
| 56 | } |
||
| 57 |