Test::echoTest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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