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

DeprecatedFunctions   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 26
rs 10
wmc 3
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 32.

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 DeprecatedFunctions
6
{
7
    /**
8
     * @return array
9
     */
10
    public function testSplit()
11
    {
12
        return split(":","a:b");
13
    }
14
15
    /**
16
     * @return string
17
     */
18
    public function testMysqlRealEscapeString()
19
    {
20
        return mysql_real_escape_string("abc");
21
    }
22
    
23
    /**
24
     * @return string
25
     */
26
    public function testMcryptCreateIv()
27
    {
28
        return mcrypt_create_iv(60, MCRYPT_RAND);
29
    }
30
}
31
?>
32
----------------------------
33
[
34
    {
35
        "type":"deprecated.function",
36
        "message":"split() is deprecated since PHP 5.3. Use explode() instead.",
37
        "file":"DeprecatedFunctions.php",
38
        "line":11
39
    },
40
    {
41
        "type":"deprecated.function",
42
        "message":"The MySQL Extension is deprecated since PHP 5.5. Use PDO instead.",
43
        "file":"DeprecatedFunctions.php",
44
        "line":19
45
    },
46
    {
47
        "type":"deprecated.function",
48
        "message":"The Mcrypt Extension is deprecated since PHP 7.1. Use paragonie/halite instead.",
49
        "file":"DeprecatedFunctions.php",
50
        "line":27
51
    }
52
]
53