Completed
Push — master ( cbb4bb...9fe020 )
by Mikael
10:38
created

DevelopController::di()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 7
loc 7
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Anax\Page;
4
5
use \Anax\DI\InjectionAwareInterface;
6
use \Anax\DI\InjectionAwareTrait;
7
8
/**
9
 * A default page rendering class.
10
 */
11
class DevelopController implements InjectionAwareInterface
12
{
13
    use InjectionAwareTrait;
14
15
16
17
    /**
18
     * @var string $namespace A namespace to prepend each template file.
19
     */
20
    private $namespace = "anax/v1/dev";
21
22
23
24
    /**
25
     * Render a page showing a menu with links to all dev pages.
26
     *
27
     * @return void
28
     */
29 View Code Duplication
    public function index()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
    {
31
        $this->di->get("view")->add("{$this->namespace}/index");
32
        $this->di->get("page")->render([
33
            "title" => "Anax development utilitites",
34
        ]);
35
    }
36
37
38
39
    /**
40
     * Render a page displaying information on services loaded in $di.
41
     *
42
     * @return void
43
     */
44 View Code Duplication
    public function di()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
45
    {
46
        $this->di->get("view")->add("{$this->namespace}/di");
47
        $this->di->get("page")->render([
48
            "title" => "Show loaded services in \$di",
49
        ]);
50
    }
51
52
53
54
    /**
55
     * Render a page displaying information on the current request.
56
     *
57
     * @return void
58
     */
59 View Code Duplication
    public function request()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
60
    {
61
        $this->di->get("view")->add("{$this->namespace}/request");
62
        $this->di->get("page")->render([
63
            "title" => "Details on current request",
64
        ]);
65
    }
66
67
68
69
    /**
70
     * Render a page displaying information on routes loaded in framework.
71
     *
72
     * @return void
73
     */
74 View Code Duplication
    public function route()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
75
    {
76
        $this->di->get("view")->add("{$this->namespace}/route");
77
        $this->di->get("page")->render([
78
            "title" => "Show loaded routes",
79
        ]);
80
    }
81
82
83
84
    /**
85
     * Render a page displaying session data.
86
     *
87
     * @return void
88
     */
89 View Code Duplication
    public function session()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
90
    {
91
        $this->di->get("view")->add("{$this->namespace}/session");
92
        $this->di->get("page")->render([
93
            "title" => "Show session data",
94
        ]);
95
    }
96
97
98
99
    /**
100
     * Render a page displaying details on view helpers.
101
     *
102
     * @return void
103
     */
104 View Code Duplication
    public function view()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
105
    {
106
        $this->di->get("view")->add("{$this->namespace}/view");
107
        $this->di->get("page")->render([
108
            "title" => "View helpers",
109
        ]);
110
    }
111
}
112