Test   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 50
rs 10
c 1
b 0
f 0
wmc 7
lcom 0
cbo 2

7 Methods

Rating   Name   Duplication   Size   Complexity  
A echoTest() 0 4 1
A paramTest() 0 4 1
A dbTest() 0 4 1
A goMain() 0 4 1
A event() 0 4 1
A admin() 0 4 1
A jsonTest() 0 17 1
1
<?php
2
3
namespace App\Controller;
4
5
use Core\Application;
6
use App\Entity\Post;
7
use Core\Utils\EntityUtils\EntitySelect;
8
9
class Test
10
{
11
    public function echoTest()
12
    {
13
        echo 'Hello Test!';
14
    }
15
16
    public function paramTest($name)
17
    {
18
        echo 'Hello ' . $name . '!';
19
    }
20
21
    public function dbTest()
22
    {
23
        return EntitySelect::select(Post::class)->findAll();
24
    }
25
26
    public function goMain()
27
    {
28
        return 'redirect: ' . Application::getUrl();
29
    }
30
31
    public function event()
32
    {
33
        echo 'Event!';
34
    }
35
36
    public function admin()
37
    {
38
        echo 'Admin page';
39
    }
40
41
    public function jsonTest()
42
    {
43
        return [
44
            [
45
                'title' => 'title 1',
46
                'content' => 'content 1'
47
            ],
48
            [
49
                'title' => 'title 2',
50
                'content' => 'content 2'
51
            ],
52
            [
53
                'title' => 'title 3',
54
                'content' => 'content 3'
55
            ]
56
        ];
57
    }
58
}
59