Passed
Push — feature/0.7.0 ( 75a66b...cbd99f )
by Ryuichi
43:15
created

Test1Controller::after()   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\ExceptionHandler;
6
use WebStream\Annotation\Attributes\Filter;
7
use WebStream\Annotation\Attributes\Header;
8
use WebStream\Annotation\Attributes\Template;
9
use WebStream\Annotation\Attributes\Custom\CustomControllerAnnotation;
10
use WebStream\Exception\Extend\ForbiddenAccessException;
11
12
class Test1Controller extends CoreController
13
{
14
    /**
15
     * @Filter(type="before")
16
     */
17
    public function before()
18
    {
19
        echo "b1";
20
    }
21
22
    /**
23
     * @Filter(type="after")
24
     */
25
    public function after()
26
    {
27
        echo "a1";
28
    }
29
30
    /**
31
     * @Template("test1.tmpl")
32
     */
33
    public function test1()
34
    {
35
    }
36
37
    public function test2()
38
    {
39
        $this->Test1->test1();
0 ignored issues
show
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

39
        $this->Test1->/** @scrutinizer ignore-call */ 
40
                      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...
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...
40
    }
41
42
    /**
43
     * @Header(allowMethod="post")
44
     */
45
    public function test3()
46
    {
47
    }
48
49
    public function test4()
50
    {
51
        throw new ForbiddenAccessException("error");
52
    }
53
54
    /**
55
     * @ExceptionHandler("WebStream\Exception\Extend\ForbiddenAccessException")
56
     */
57
    public function test4Error($params)
58
    {
59
        var_dump($params);
0 ignored issues
show
Security Debugging Code introduced by
var_dump($params) looks like debug code. Are you sure you do not want to remove it?
Loading history...
60
    }
61
62
63
    public function test9()
64
    {
65
66
    }
67
68
    /**
69
     * @CustomControllerAnnotation(type="custom")
70
     */
71
    public function test10()
72
    {
73
    }
74
}
75