Test Setup Failed
Push — master ( 3028d7...678984 )
by Markus
03:32
created

HomeController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 10
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A indexAction() 0 14 1
1
<?php
2
3
namespace Anax\Home;
4
5
use Anax\Commons\ContainerInjectableInterface;
6
use Anax\Commons\ContainerInjectableTrait;
7
use Anax\Forum\Forum;
8
9
class HomeController implements ContainerInjectableInterface
10
{
11
    use ContainerInjectableTrait;
12
13
    public function indexAction()
14
    {
15
        $title = "Home page";
16
        $forum = new Forum();
17
        $forum->setDb($this->di->get("dbqb"));
18
19
        $page = $this->di->get("page");
20
21
        $page->add("home/index", [
22
            "items" => $forum->findAll(),
23
        ]);
24
25
        return $page->render([
26
            "title" => $title,
27
        ]);
28
    }
29
}
30