Passed
Push — feature/0.7.0 ( cbd99f...49f0a6 )
by Ryuichi
42:21
created

Test1Controller::test7()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace WebStream\Test\Controller;
3
4
use WebStream\Core\CoreController;
5
use WebStream\Annotation\Attributes\Alias;
6
use WebStream\Annotation\Attributes\ExceptionHandler;
7
use WebStream\Annotation\Attributes\Filter;
8
use WebStream\Annotation\Attributes\Header;
9
use WebStream\Annotation\Attributes\Template;
10
use WebStream\Annotation\Attributes\Validate;
11
use WebStream\Annotation\Attributes\Custom\CustomControllerAnnotation;
12
use WebStream\Exception\Extend\ForbiddenAccessException;
13
14
class Test1Controller extends CoreController
15
{
16
    /**
17
     * @Filter(type="before")
18
     */
19
    public function before()
20
    {
21
        echo "b1";
22
    }
23
24
    /**
25
     * @Filter(type="after")
26
     */
27
    public function after()
28
    {
29
        echo "a1";
30
    }
31
32
    /**
33
     * @Template("test1.tmpl")
34
     */
35
    public function test1()
36
    {
37
    }
38
39
    public function test2()
40
    {
41
        $this->Test1->test1();
0 ignored issues
show
Bug Best Practice introduced by
The property Test1 does not exist on WebStream\Test\Controller\Test1Controller. Since you implemented __get, consider adding a @property annotation.
Loading history...
Bug introduced by
The method test1() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

41
        $this->Test1->/** @scrutinizer ignore-call */ 
42
                      test1();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
42
    }
43
44
    /**
45
     * @Header(allowMethod="post")
46
     */
47
    public function test3()
48
    {
49
    }
50
51
    public function test4()
52
    {
53
        throw new ForbiddenAccessException("error");
54
    }
55
56
    /**
57
     * @ExceptionHandler("WebStream\Exception\Extend\ForbiddenAccessException")
58
     */
59
    public function test4Error($params)
60
    {
61
        echo $params['method'];
62
    }
63
64
    /**
65
     * @Alias(name="test5")
66
     */
67
    public function test5Alias()
68
    {
69
        echo "t5";
70
    }
71
72
    /**
73
     * @Validate(key="test", rule="required", method="get")
74
     */
75
    public function test6()
76
    {
77
        echo "t6";
78
    }
79
80
    /**
81
     * @Validate(key="test", rule="length[3]")
82
     */
83
    public function test7()
84
    {
85
        echo "t7";
86
    }
87
88
    public function test9()
89
    {
90
91
    }
92
93
    /**
94
     * @CustomControllerAnnotation(name="t10")
95
     */
96
    public function test10()
97
    {
98
        echo $this->annotation[CustomControllerAnnotation::class][0]['name'];
99
    }
100
}
101