| Conditions | 1 |
| Paths | 1 |
| Total Lines | 23 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 18 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | 1 | public function indexActionGet() : object |
|
| 25 | { |
||
| 26 | 1 | $page = $this->di->get("page"); |
|
| 27 | 1 | $tags = new Tags(); |
|
| 28 | 1 | $tags->setDb($this->di->get("dbqb")); |
|
| 29 | 1 | $questions = new Questions(); |
|
| 30 | 1 | $questions->setDb($this->di->get("dbqb")); |
|
| 31 | 1 | $users = new User(); |
|
| 32 | 1 | $users->setDb($this->di->get("dbqb")); |
|
| 33 | |||
| 34 | 1 | $homeModel = new HomeModel(); |
|
| 35 | 1 | $recentTopics = $homeModel->recentTopics($questions->findAll()); |
|
| 36 | 1 | $topUsers = $homeModel->topUsers($users->findAll()); |
|
| 37 | 1 | $topTags = $homeModel->topTags($tags->findAll(), $questions->findAll()); |
|
| 38 | |||
| 39 | 1 | $page->add("home/home", [ |
|
| 40 | 1 | "tags" => $topTags, |
|
| 41 | 1 | "questions" => $recentTopics, |
|
| 42 | 1 | "users" => $topUsers |
|
| 43 | ]); |
||
| 44 | |||
| 45 | 1 | return $page->render([ |
|
| 46 | 1 | "title" => "Home", |
|
| 47 | ]); |
||
| 50 |