Completed
Push — master ( d8f6c8...9bf369 )
by Дмитрий
10s
created

DeprecatedIniOptions   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 27
rs 10
wmc 5
lcom 0
cbo 0
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 33.

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 DeprecatedIniOptions
6
{
7
    public function testIniSet()
8
    {
9
        ini_set("asp_tags", "1");
10
    }
11
12
    public function testIniAlter()
13
    {
14
        ini_alter("mbstring.http_input", "pass");
15
    }
16
17
    public function testIniGet()
18
    {
19
        ini_get("highlight.bg");
20
    }
21
22
    public function testIniRestore()
23
    {
24
        ini_restore("safe_mode");
25
    }
26
27
    public function testOtherFunction()
28
    {
29
        htmlspecialchars("asp_tags");
30
    }
31
}
32
?>
33
----------------------------
34
[
35
    {
36
        "type":"deprecated.option",
37
        "message":"Ini option asp_tags is a deprecated option since PHP 7.0.0.",
38
        "file":"DeprecatedIniOptions.php",
39
        "line":8
40
    },
41
    {
42
        "type":"deprecated.option",
43
        "message":"Ini option mbstring.http_input is a deprecated option since PHP 5.6.0. Use 'default_charset' instead.",
44
        "file":"DeprecatedIniOptions.php",
45
        "line":13
46
    },
47
    {
48
        "type":"deprecated.option",
49
        "message":"Ini option highlight.bg is a deprecated option since PHP 5.4.0.",
50
        "file":"DeprecatedIniOptions.php",
51
        "line":18
52
    },
53
    {
54
        "type":"deprecated.option",
55
        "message":"Ini option safe_mode is a deprecated option since PHP 5.3.0 (removed in PHP 5.4.0).",
56
        "file":"DeprecatedIniOptions.php",
57
        "line":23
58
    }
59
]
60