Completed
Push — master ( b7cb0e...ffcfdb )
by Дмитрий
02:53
created

DebugCode::testVarDumpExpected()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 9
rs 9.6666
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 5 and the first side effect is on line 117.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
namespace Tests\Compiling\Statements;
4
5
class DebugCode
6
{
7
    /**
8
     * @return bool
9
     */
10
    public function testVarDumpUnexpected()
11
    {
12
        var_dump(1);
0 ignored issues
show
Security Debugging Code introduced by
var_dump(1); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
13
14
        return true;
15
    }
16
17
    /**
18
     * @return bool
19
     */
20
    public function testVarDumpExpected()
21
    {
22
        /**
23
         * @expected
24
         */
25
        var_dump(1);
0 ignored issues
show
Security Debugging Code introduced by
var_dump(1); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
26
27
        return true;
28
    }
29
30
    /**
31
     * @return bool
32
     */
33
    public function testVarDumpWitSimpleComment()
34
    {
35
        /**
36
         * Expected
37
         */
38
        var_dump(1);
0 ignored issues
show
Security Debugging Code introduced by
var_dump(1); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
39
40
        return true;
41
    }
42
43
    /**
44
     * @return bool
45
     */
46
    public function testVarExporUnexpected()
47
    {
48
        var_export(1);
49
50
        return true;
51
    }
52
53
    /**
54
     * @return bool
55
     */
56
    public function testVarExporExpected()
57
    {
58
        /**
59
         * @expected
60
         */
61
        var_export(1);
62
63
        return true;
64
    }
65
66
    /**
67
     * @return bool
68
     */
69
    public function testVarExporWitSimpleComment()
70
    {
71
        /**
72
         * Expected
73
         */
74
        var_export(1);
75
76
        return true;
77
    }
78
79
    /**
80
     * @return bool
81
     */
82
    public function testDebugZvalDumpUnexpected()
83
    {
84
        debug_zval_dump(1);
85
86
        return true;
87
    }
88
89
    /**
90
     * @return bool
91
     */
92
    public function testDebugZvalDumpExpected()
93
    {
94
        /**
95
         * @expected
96
         */
97
        debug_zval_dump(1);
98
99
        return true;
100
    }
101
102
    /**
103
     * @return bool
104
     */
105
    public function testDebugZvalDumpWitSimpleComment()
106
    {
107
        /**
108
         * Expected
109
         */
110
        debug_zval_dump(1);
111
112
        return true;
113
    }
114
}
115
116
?>
117
----------------------------
118
[{"type":"debug.code","message":"Function var_dump() is a debug code, please don`t use it in production.","file":"DebugCode.php","line":11},{"type":"debug.code","message":"Function var_dump() is a debug code, please don`t use it in production.","file":"DebugCode.php","line":11},{"type":"debug.code","message":"Function var_dump() is a debug code, please don`t use it in production.","file":"DebugCode.php","line":37},{"type":"debug.code","message":"Function var_dump() is a debug code, please don`t use it in production.","file":"DebugCode.php","line":37},{"type":"debug.code","message":"Function var_export() is a debug code, please don`t use it in production.","file":"DebugCode.php","line":47},{"type":"debug.code","message":"Function var_export() is a debug code, please don`t use it in production.","file":"DebugCode.php","line":47},{"type":"debug.code","message":"Function var_export() is a debug code, please don`t use it in production.","file":"DebugCode.php","line":73},{"type":"debug.code","message":"Function var_export() is a debug code, please don`t use it in production.","file":"DebugCode.php","line":73},{"type":"debug.code","message":"Function debug_zval_dump() is a debug code, please don`t use it in production.","file":"DebugCode.php","line":83},{"type":"debug.code","message":"Function debug_zval_dump() is a debug code, please don`t use it in production.","file":"DebugCode.php","line":83},{"type":"debug.code","message":"Function debug_zval_dump() is a debug code, please don`t use it in production.","file":"DebugCode.php","line":109},{"type":"debug.code","message":"Function debug_zval_dump() is a debug code, please don`t use it in production.","file":"DebugCode.php","line":109}]
119