mysql.php ➔ mysql_connect()   F
last analyzed

Complexity

Conditions 17
Paths 1620

Size

Total Lines 92

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 40
CRAP Score 17.217

Importance

Changes 0
Metric Value
cc 17
nc 1620
nop 5
dl 0
loc 92
ccs 40
cts 44
cp 0.9091
crap 17.217
rs 1.0145
c 0
b 0
f 0

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
0 ignored issues
show
Coding Style introduced by
Class found in ".php" file; use ".inc" extension instead
Loading history...
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
introduced by
The PHP open tag must be followed by exactly one blank line
Loading history...
2
/**
0 ignored issues
show
introduced by
Namespaced classes, interfaces and traits should not begin with a file doc comment
Loading history...
3
 * php7-mysql-shim
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
4
 *
5
 * @author Davey Shafik <[email protected]>
0 ignored issues
show
Coding Style introduced by
Expected "Squiz Pty Ltd <[email protected]>" for author tag
Loading history...
Coding Style introduced by
The tag in position 1 should be the @package tag
Loading history...
Coding Style introduced by
Tag value for @author tag indented incorrectly; expected 4 spaces but found 1
Loading history...
6
 * @copyright Copyright (c) 2017 Davey Shafik
0 ignored issues
show
Coding Style Documentation introduced by
Expected "xxxx-xxxx Squiz Pty Ltd (ABN 77 084 670 600)" for copyright declaration
Loading history...
Coding Style introduced by
The tag in position 2 should be the @subpackage tag
Loading history...
Coding Style introduced by
@copyright tag must contain a year and the name of the copyright holder
Loading history...
7
 * @license MIT License
0 ignored issues
show
Coding Style introduced by
The tag in position 3 should be the @author tag
Loading history...
Coding Style introduced by
Tag value for @license tag indented incorrectly; expected 3 spaces but found 1
Loading history...
8
 * @link https://github.com/dshafik/php7-mysql-shim
0 ignored issues
show
Coding Style introduced by
The tag in position 4 should be the @copyright tag
Loading history...
Coding Style introduced by
Tag value for @link tag indented incorrectly; expected 6 spaces but found 1
Loading history...
9
 */
0 ignored issues
show
Coding Style introduced by
PHP version not specified
Loading history...
Coding Style Documentation introduced by
Missing @package tag in file comment
Loading history...
Coding Style Documentation introduced by
Missing @subpackage tag in file comment
Loading history...
Coding Style introduced by
Missing @category tag in file comment
Loading history...
10
11
/**
12
 * A drop-in replacement for ext/mysql in PHP 7+ using ext/mysqli instead
13
 *
14
 * This library is meant to be a _stop-gap_. It will be slower than using
15
 * the native functions directly.
16
 *
17
 * You should switch to ext/pdo_mysql or ext/mysqli, and migrate to prepared
18
 * queries (@see http://php.net/manual/en/pdo.prepared-statements.php) to
19
 * ensure you are securely interacting with your database.
20
 */
21
namespace {
22
23
    if (!extension_loaded('mysql')) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
24
        if (!extension_loaded('mysqli')) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
25
            trigger_error('php7-mysql-shim: ext/mysqli is required', E_USER_ERROR);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
26
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
27
28
        define('MYSQL_ASSOC', 1);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
29
        define('MYSQL_NUM', 2);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
30
        define('MYSQL_BOTH', 3);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
31
        define('MYSQL_CLIENT_COMPRESS', 32);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
32
        define('MYSQL_CLIENT_SSL', 2048);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
33
        define('MYSQL_CLIENT_INTERACTIVE', 1024);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
34
        define('MYSQL_CLIENT_IGNORE_SPACE', 256);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
35
36
        function mysql_connect(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_connect" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_connect" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_connect" is invalid; consider "Mysql_connect" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_connect()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
37
            $hostname = null,
0 ignored issues
show
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
38
            $username = null,
0 ignored issues
show
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
39
            $password = null,
0 ignored issues
show
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
40
            $new = false,
0 ignored issues
show
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
41
            $flags = 0
42
        ) {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on a new line
Loading history...
43 65
            if ($new !== false) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
44 1
                trigger_error('Argument $new is no longer supported in PHP > 7', E_USER_WARNING);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
45
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
46
47 64
            if (null === $hostname) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
48 1
                $hostname = ini_get('mysqli.default_host') ?: null;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
49
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
50 64
            if (null === $username) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
51 1
                $username = ini_get('mysqli.default_user') ?: null;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
52
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
53 64
            if (null === $password) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
54 61
                $password = ini_get('mysqli.default_pw') ?: null;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
55
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
56
57 64
            $socket = '';
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
58 64
            if (strpos($hostname, ':/') === 0) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
59
                // it's a unix socket
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style Documentation introduced by
Inline comments must start with a capital letter
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
introduced by
Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
Loading history...
60
                $socket = $hostname;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
61
                $hostname = 'localhost';
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
62
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
63
64 64
            $hash = sha1($hostname . $username . $flags);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
65
            /* persistent connections start with p: */
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Block comment text must start on a new line
Loading history...
66
            /* don't use a cached link for those */
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
67 64
            if ($hostname[1] !== ':' && isset(\Dshafik\MySQL::$connections[$hash])) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
68 10
                \Dshafik\MySQL::$last_connection = \Dshafik\MySQL::$connections[$hash]['conn'];
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
Coding Style introduced by
Variable "last_connection" is not in valid camel caps format
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 17 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
69 10
                \Dshafik\MySQL::$connections[$hash]['refcount'] += 1;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
70 10
                return \Dshafik\MySQL::$connections[$hash]['conn'];
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
71
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
72
73
            /* A custom port can be specified by appending the hostname with :{port} e.g. hostname:3307 */
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 106 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
74 55
            if (preg_match('/^(.+):([\d]+)$/', $hostname, $port_matches) === 1 && $port_matches[1] !== "p") {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Variable "port_matches" is not in valid camel caps format
Loading history...
Coding Style Comprehensibility introduced by
The string literal p does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 109 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
75
                $hostname = $port_matches[1];
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Variable "port_matches" is not in valid camel caps format
Loading history...
76
                $port = (int) $port_matches[2];
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Coding Style introduced by
A cast statement should not be followed as per the coding-style.
Loading history...
Coding Style introduced by
Variable "port_matches" is not in valid camel caps format
Loading history...
77
            } else {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Expected newline after closing brace
Loading history...
78 55
                $port = null;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
79
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
80
81
            /* No flags, means we can use mysqli_connect() */
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
82 55
            if ($flags === 0) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
83 53
                $conn = mysqli_connect($hostname, $username, $password, '', $port);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
84 52
                if (!$conn instanceof mysqli) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
85 1
                    return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
86
                }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
87 51
                \Dshafik\MySQL::$last_connection = $conn;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
Coding Style introduced by
Variable "last_connection" is not in valid camel caps format
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
88 51
                $conn->hash = $hash;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 25 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
89 51
                \Dshafik\MySQL::$connections[$hash] = array('refcount' => 1, 'conn' => $conn);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
90
91 51
                return $conn;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
92
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
93
94
            /* Flags means we need to use mysqli_real_connect() instead, and handle exceptions */
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
95
            try {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
96 2
                \Dshafik\MySQL::$last_connection = $conn = mysqli_init();
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
Coding Style introduced by
Variable "last_connection" is not in valid camel caps format
Loading history...
Coding Style introduced by
Assignments must be the first block of code on a line
Loading history...
97
98 2
                mysqli_real_connect(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
99 2
                    $conn,
100 2
                    $hostname,
101 2
                    $username,
102 2
                    $password,
103 2
                    '',
104 2
                    $port,
105 2
                    $socket,
106 2
                    $flags
107
                );
108
109
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 16
Loading history...
110
                // PHPUnit turns the warning from mysqli_real_connect into an exception, so this never runs
0 ignored issues
show
introduced by
Line exceeds 80 characters; contains 107 characters
Loading history...
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 107 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 16
Loading history...
111
                if ($conn === false) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
112
                    return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 20
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
113
                }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 16
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
114
                // @codeCoverageIgnoreEnd
0 ignored issues
show
introduced by
There must be no blank line following an inline comment
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 16
Loading history...
115
116 1
                $conn->hash = $hash;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 16
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 25 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
117 1
                \Dshafik\MySQL::$connections[$hash] = array('refcount' => 1, 'conn' => $conn);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 16
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
118
119 1
                return $conn;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 16
Loading history...
120 1
            } catch (\Throwable $e) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Expected newline after closing brace
Loading history...
121 1
                trigger_error($e->getMessage(), E_USER_WARNING);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
122
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
123
                // PHPUnit turns the warning into an exception, so this never runs
0 ignored issues
show
introduced by
Line exceeds 80 characters; contains 82 characters
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
124
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
125
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
126
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
End comment for long condition not found; expected "//end try"
Loading history...
127
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_connect()
Loading history...
128
129
        function mysql_pconnect(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_pconnect" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_pconnect" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_pconnect" is invalid; consider "Mysql_pconnect" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_pconnect()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
130
            $hostname = null,
0 ignored issues
show
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
131
            $username = null,
0 ignored issues
show
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
132
            $password = null,
0 ignored issues
show
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
133
            $flags = 0
134
        ) {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on a new line
Loading history...
135 1
            $hostname = 'p:' . $hostname;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
136 1
            return mysql_connect($hostname, $username, $password, false, $flags);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
137
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_pconnect()
Loading history...
138
139
        function mysql_close(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_close" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_close" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_close" is invalid; consider "Mysql_close" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_close()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
140
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
141 89
            $isDefault = ($link === null);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
The value of a comparison must not be assigned to a variable
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
142
143 89
            $link = \Dshafik\MySQL::getConnection($link, __FUNCTION__);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
144 89
            if ($link === null) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
145
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
146
                // PHPUnit Warning -> Exception
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
147
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
148
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
149
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
150
151 89
            if (isset(\Dshafik\MySQL::$connections[$link->hash])) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
152 61
                \Dshafik\MySQL::$connections[$link->hash]['refcount'] -= 1;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
153
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
154
155 89
            $return = true;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
156 89
            if (\Dshafik\MySQL::$connections[$link->hash]['refcount'] === 0) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
157 52
                $return = mysqli_close($link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
158 52
                unset(\Dshafik\MySQL::$connections[$link->hash]);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
159
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
160
161 89
            if ($isDefault) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
162 89
                Dshafik\MySQL::$last_connection = null;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
Coding Style introduced by
Variable "last_connection" is not in valid camel caps format
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
163
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
164
165 89
            return $return;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
166
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_close()
Loading history...
167
168
        function mysql_select_db($databaseName, \mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_select_db" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_select_db" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_select_db" is invalid; consider "Mysql_Select_db" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_select_db()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
169
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
170 54
            $link = \Dshafik\MySQL::getConnection($link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
171
172 54
            return mysqli_query(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
173 54
                $link,
174 54
                'USE `' . mysqli_real_escape_string($link, $databaseName) . '`'
175 54
            ) !== false;
0 ignored issues
show
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
176
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_select_db()
Loading history...
177
178
        function mysql_query($query, \mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_query" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_query" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_query" is invalid; consider "Mysql_query" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_query()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
179
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
180 57
            return mysqli_query(\Dshafik\MySQL::getConnection($link), $query);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
181
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_query()
Loading history...
182
183
        function mysql_unbuffered_query($query, \mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_unbuffered_query" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_unbuffered_query" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_unbuffered_query" is invalid; consider "Mysql_Unbuffered_query" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_unbuffered_query()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
184
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
185 4
            $link = \Dshafik\MySQL::getConnection($link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
186 4
            if (mysqli_real_query($link, $query)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
187 3
                return mysqli_use_result($link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
188
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
189
190 1
            return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
191
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_unbuffered_query()
Loading history...
192
193
        function mysql_db_query($databaseName, $query, \mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_db_query" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_db_query" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_db_query" is invalid; consider "Mysql_Db_query" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_db_query()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
194
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
195 2
            if (mysql_select_db($databaseName, $link)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
196 1
                return mysql_query($query, $link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
197
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
198 1
            return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
199
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_db_query()
Loading history...
200
201
        function mysql_list_dbs(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_list_dbs" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_list_dbs" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_list_dbs" is invalid; consider "Mysql_List_dbs" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_list_dbs()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
202
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
203 2
            return mysql_query('SHOW DATABASES', $link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
204
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_list_dbs()
Loading history...
205
206
        function mysql_list_tables($databaseName, \mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_list_tables" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_list_tables" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_list_tables" is invalid; consider "Mysql_List_tables" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_list_tables()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
207
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
208 3
            $link = \Dshafik\MySQL::getConnection($link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
209 3
            $query = sprintf(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
210 3
                'SHOW TABLES FROM `%s`',
211 3
                mysql_real_escape_string($databaseName, $link)
212
            );
213 3
            return mysql_query($query, $link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 12
Loading history...
214
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_list_tables()
Loading history...
215
216
        function mysql_list_fields($databaseName, $tableName, \mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_list_fields" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_list_fields" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_list_fields" is invalid; consider "Mysql_List_fields" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_list_fields()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
217
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
218 3
            $link = \Dshafik\MySQL::getConnection($link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
219
220 3
            $query = sprintf(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
221 3
                'SHOW COLUMNS FROM `%s`.`%s`',
222 3
                mysqli_real_escape_string($link, $databaseName),
223 3
                mysqli_real_escape_string($link, $tableName)
224
            );
225
226 3
            $result = mysql_query($query, $link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 12
Loading history...
227
228 3
            if ($result instanceof \mysqli_result) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 12
Loading history...
229 2
                $result->table = $tableName;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 16
Loading history...
230 2
                return $result;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 16
Loading history...
231
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 12
Loading history...
232
233 1
            trigger_error('mysql_list_fields(): Unable to save MySQL query result', E_USER_WARNING);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 12
Loading history...
234
            // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 12
Loading history...
235
            return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
236
            // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 12
Loading history...
237
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_list_fields()
Loading history...
238
239
        function mysql_list_processes(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_list_processes" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_list_processes" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_list_processes" is invalid; consider "Mysql_List_processes" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_list_processes()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
240
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
241
            return mysql_query('SHOW PROCESSLIST', $link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
242
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_list_processes()
Loading history...
243
244
        function mysql_error(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_error" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_error" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_error" is invalid; consider "Mysql_error" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_error()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
245
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
246 32
            return mysqli_error(\Dshafik\MySQL::getConnection($link));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
247
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_error()
Loading history...
248
249
        function mysql_errno(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_errno" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_errno" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_errno" is invalid; consider "Mysql_errno" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_errno()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
250
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
251 1
            return mysqli_errno(\Dshafik\MySQL::getConnection($link));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
252
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_errno()
Loading history...
253
254
        function mysql_affected_rows(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_affected_rows" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_affected_rows" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_affected_rows" is invalid; consider "Mysql_Affected_rows" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_affected_rows()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
255
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
256 1
            return mysqli_affected_rows(\Dshafik\MySQL::getConnection($link));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
257
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_affected_rows()
Loading history...
258
259
        function mysql_insert_id($link = null) /*|*/
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_insert_id" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_insert_id" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_insert_id" is invalid; consider "Mysql_Insert_id" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_insert_id()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
260
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
261 1
            return mysqli_insert_id(\Dshafik\MySQL::getConnection($link));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
262
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_insert_id()
Loading history...
263
264
        function mysql_result($result, $row, $field = 0)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_result" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_result" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_result" is invalid; consider "Mysql_result" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_result()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
265
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
266 8
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
267
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
268
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
269
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
270
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
271
272 7
            if (!mysqli_data_seek($result, $row)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
273 1
                trigger_error(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
274 1
                    sprintf(
275 1
                        'mysql_result(): Unable to jump to row %d on MySQL result index %s',
276 1
                        $row,
277 1
                        spl_object_hash($result)
278
                    ),
279 1
                    E_USER_WARNING
280
                );
281
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 16
Loading history...
282
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
283
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 16
Loading history...
284
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
285
286 6
            $found = true;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
287 6
            if (strpos($field, '.') !== false) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
288 3
                list($table, $name) = explode('.', $field);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
289 3
                $i = 0;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 18 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
290 3
                $found = false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 14 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
291 3
                mysqli_field_seek($result, 0);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
292 3
                while ($column = mysqli_fetch_field($result)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Variable assignment found within a condition. Did you mean to do a comparison ?
Loading history...
293 3
                    if ($column->table === $table && $column->name === $name) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
294 2
                        $field = $i;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 24
Loading history...
295 2
                        $found = true;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 24
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
296 2
                        break;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 24
Loading history...
297
                    }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
298 3
                    $i++;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
299
                }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
300
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
301
302 6
            $row = mysql_fetch_array($result);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
303 6
            if ($found && array_key_exists($field, $row)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
304 4
                return $row[$field];
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
305
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
306
307 2
            trigger_error(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
308 2
                sprintf(
309 2
                    '%s(): %s not found in MySQL result index %s',
310 2
                    __FUNCTION__,
311 2
                    $field,
312 2
                    spl_object_hash($result)
313
                ),
314 2
                E_USER_WARNING
315
            );
316
            // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 12
Loading history...
317
            return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
318
            // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 12
Loading history...
319
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_result()
Loading history...
320
321
        function mysql_num_rows($result)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_num_rows" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_num_rows" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_num_rows" is invalid; consider "Mysql_Num_rows" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_num_rows()
Loading history...
introduced by
Missing function doc comment
Loading history...
322
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
323 14
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
324
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
325
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
326
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
327
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
328
329 13
            $previous = error_reporting(0);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
330 13
            $rows = mysqli_num_rows($result);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
331 13
            error_reporting($previous);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
332
333 13
            return $rows;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
334
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_num_rows()
Loading history...
335
336
        function mysql_num_fields($result)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_num_fields" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_num_fields" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_num_fields" is invalid; consider "Mysql_Num_fields" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_num_fields()
Loading history...
introduced by
Missing function doc comment
Loading history...
337
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
338 3
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
339
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
340
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
341
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
342
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
343 1
            return mysqli_num_fields($result);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
344
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_num_fields()
Loading history...
345
346
        function mysql_fetch_row($result)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_fetch_row" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_fetch_row" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_fetch_row" is invalid; consider "Mysql_Fetch_row" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_fetch_row()
Loading history...
introduced by
Missing function doc comment
Loading history...
347
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
348 6
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
349
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
350
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
351
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
352
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
353 5
            return mysqli_fetch_row($result) ?: false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
354
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fetch_row()
Loading history...
355
356
        function mysql_fetch_array($result, $resultType = MYSQL_BOTH)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_fetch_array" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_fetch_array" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_fetch_array" is invalid; consider "Mysql_Fetch_array" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_fetch_array()
Loading history...
introduced by
Missing function doc comment
Loading history...
357
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
358 11
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
359
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
360
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
361
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
362
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
363 10
            return mysqli_fetch_array($result, $resultType) ?: false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
364
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fetch_array()
Loading history...
365
366
        function mysql_fetch_assoc($result) /* : array|null */
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_fetch_assoc" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_fetch_assoc" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_fetch_assoc" is invalid; consider "Mysql_Fetch_assoc" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_fetch_assoc()
Loading history...
introduced by
Missing function doc comment
Loading history...
Unused Code Comprehensibility introduced by
80% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
367
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
368 9
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
369
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
370
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
371
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
372
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
373
374 8
            return mysqli_fetch_assoc($result) ?: false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
375
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fetch_assoc()
Loading history...
376
377
        function mysql_fetch_object($result, $class = null, array $params = array()) /* : object|null */
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_fetch_object" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_fetch_object" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_fetch_object" is invalid; consider "Mysql_Fetch_object" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_fetch_object()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
Unused Code Comprehensibility introduced by
60% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 104 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
378
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
379 3
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
380
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
381
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
382
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
383
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
384
385 2
            if ($class === null) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
386 2
                $object = mysqli_fetch_object($result);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
387
            } else {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Expected newline after closing brace
Loading history...
388
                $object = mysqli_fetch_object($result, $class, $params);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
389
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
390
391 2
            return $object ?: false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
Coding Style introduced by
Inline shorthand IF statement requires brackets around comparison
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
392
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fetch_object()
Loading history...
393
394
        function mysql_data_seek($result, $offset)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_data_seek" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_data_seek" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_data_seek" is invalid; consider "Mysql_Data_seek" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_data_seek()
Loading history...
introduced by
Missing function doc comment
Loading history...
395
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
396 1
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
397
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
398
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
399
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
400
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
401
            return mysqli_data_seek($result, $offset);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
402
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_data_seek()
Loading history...
403
404
        function mysql_fetch_lengths($result) /* : array|*/
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_fetch_lengths" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_fetch_lengths" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_fetch_lengths" is invalid; consider "Mysql_Fetch_lengths" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_fetch_lengths()
Loading history...
introduced by
Missing function doc comment
Loading history...
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
405
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
406 1
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
407
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
408
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
409
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
410
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
411
            return mysqli_fetch_lengths($result);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
412
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fetch_lengths()
Loading history...
413
414
        function mysql_fetch_field($result) /* : object|*/
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_fetch_field" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_fetch_field" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_fetch_field" is invalid; consider "Mysql_Fetch_field" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_fetch_field()
Loading history...
introduced by
Missing function doc comment
Loading history...
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
415
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
416 4
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
417
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
418
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
419
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
420
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
421 2
            $res = mysqli_fetch_field($result);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
422 2
            if ($res instanceof \stdClass) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
423 2
                $res->not_null = ($res->flags & MYSQLI_NOT_NULL_FLAG) ? 1 : 0;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Variable "not_null" is not in valid camel caps format
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Coding Style introduced by
The value of a comparison must not be assigned to a variable
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
424 2
                $res->primary_key = ($res->flags & MYSQLI_PRI_KEY_FLAG ) ? 1 : 0;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Variable "primary_key" is not in valid camel caps format
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Coding Style introduced by
The value of a comparison must not be assigned to a variable
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
425 2
                $res->unique_key = ($res->flags & MYSQLI_UNIQUE_KEY_FLAG ) ? 1 : 0;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Variable "unique_key" is not in valid camel caps format
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Coding Style introduced by
The value of a comparison must not be assigned to a variable
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
426 2
                $res->multiple_key = ($res->flags & MYSQLI_MULTIPLE_KEY_FLAG ) ? 1 : 0;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Variable "multiple_key" is not in valid camel caps format
Loading history...
Coding Style introduced by
The value of a comparison must not be assigned to a variable
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
427 2
                $res->numeric = ($res->flags & MYSQLI_NUM_FLAG ) ? 1 : 0;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Coding Style introduced by
The value of a comparison must not be assigned to a variable
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
428 2
                $res->blob = ($res->flags & MYSQLI_BLOB_FLAG ) ? 1 : 0;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 9 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Coding Style introduced by
The value of a comparison must not be assigned to a variable
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
429 2
                $res->unsigned = ($res->flags & MYSQLI_UNSIGNED_FLAG ) ? 1 : 0;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Coding Style introduced by
The value of a comparison must not be assigned to a variable
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
430 2
                $res->zerofill = ($res->flags & MYSQLI_ZEROFILL_FLAG ) ? 1 : 0;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Coding Style introduced by
The value of a comparison must not be assigned to a variable
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
431
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
432 2
            return $res;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
433
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fetch_field()
Loading history...
434
435
        function mysql_field_seek($result, $field)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_field_seek" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_field_seek" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_field_seek" is invalid; consider "Mysql_Field_seek" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_field_seek()
Loading history...
introduced by
Missing function doc comment
Loading history...
436
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
437 1
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
438
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
439
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
440
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
441
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
442
            return mysqli_field_seek($result, $field);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
443
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_field_seek()
Loading history...
444
445
        function mysql_free_result($result)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_free_result" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_free_result" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_free_result" is invalid; consider "Mysql_Free_result" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_free_result()
Loading history...
introduced by
Missing function doc comment
Loading history...
446
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
447 2
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
448
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
449
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
450
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
451
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
452 1
            return mysqli_free_result($result);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
453
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_free_result()
Loading history...
454
455 View Code Duplication
        function mysql_field_name($result, $field)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_field_name" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_field_name" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_field_name" is invalid; consider "Mysql_Field_name" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_field_name()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
456
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
457 4
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
458
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
459
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
460
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
461
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
462 3
            return \Dshafik\MySQL::mysqlFieldInfo($result, $field, 'name');
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
463
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_field_name()
Loading history...
464
465
        function mysql_field_table($result, $field)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_field_table" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_field_table" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_field_table" is invalid; consider "Mysql_Field_table" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_field_table()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
466
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
467 4
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
468
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
469
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
470
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
471
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
472 3
            return \Dshafik\MySQL::mysqlFieldInfo($result, $field, 'table');
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
473
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_field_table()
Loading history...
474
475
        function mysql_field_len($result, $field)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_field_len" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_field_len" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_field_len" is invalid; consider "Mysql_Field_len" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_field_len()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
476
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
477 4
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
478
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
479
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
480
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
481
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
482 3
            return \Dshafik\MySQL::mysqlFieldInfo($result, $field, 'length');
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
483
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_field_len()
Loading history...
484
485 View Code Duplication
        function mysql_field_type($result, $field)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_field_type" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_field_type" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_field_type" is invalid; consider "Mysql_Field_type" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_field_type()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
486
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
487 4
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
488
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
489
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
490
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
491
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
492 3
            return \Dshafik\MySQL::mysqlFieldInfo($result, $field, 'type');
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
493
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_field_type()
Loading history...
494
495
        function mysql_field_flags($result, $field)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_field_flags" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_field_flags" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_field_flags" is invalid; consider "Mysql_Field_flags" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_field_flags()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
496
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
497 4
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
498
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
499
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
500
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
501
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
502 3
            return \Dshafik\MySQL::mysqlFieldInfo($result, $field, 'flags');
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
503
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_field_flags()
Loading history...
504
505
        function mysql_escape_string($unescapedString)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_escape_string" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_escape_string" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_escape_string" is invalid; consider "Mysql_Escape_string" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_escape_string()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
506
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
507 2
            if (\Dshafik\MySQL::$last_connection === null) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
Coding Style introduced by
Variable "last_connection" is not in valid camel caps format
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
508 2
                trigger_error(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
509 2
                    sprintf(
510 2
                        '%s() is insecure; use mysql_real_escape_string() instead!',
511 2
                        __FUNCTION__
512
                    ),
513 2
                    E_USER_NOTICE
514
                );
515
516 1
                return \Dshafik\MySQL::escapeString($unescapedString);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 16
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
517
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
518
            return mysql_real_escape_string($unescapedString, null);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
519
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_escape_string()
Loading history...
520
521
        function mysql_real_escape_string($unescapedString, \mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_real_escape_string" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_real_escape_string" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_real_escape_string" is invalid; consider "Mysql_Real_Escape_string" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_real_escape_string()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
522
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
523 3
            return mysqli_escape_string(\Dshafik\MySQL::getConnection($link), $unescapedString);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
524
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_real_escape_string()
Loading history...
525
526
        function mysql_stat(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_stat" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_stat" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_stat" is invalid; consider "Mysql_stat" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_stat()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
527
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
528
            return mysqli_stat(\Dshafik\MySQL::getConnection($link));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
529
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_stat()
Loading history...
530
531
        function mysql_thread_id(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_thread_id" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_thread_id" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_thread_id" is invalid; consider "Mysql_Thread_id" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_thread_id()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
532
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
533
            return mysqli_thread_id(\Dshafik\MySQL::getConnection($link));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
534
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_thread_id()
Loading history...
535
536
        function mysql_client_encoding(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_client_encoding" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_client_encoding" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_client_encoding" is invalid; consider "Mysql_Client_encoding" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_client_encoding()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
537
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
538
            return mysqli_character_set_name(\Dshafik\MySQL::getConnection($link));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
539
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_client_encoding()
Loading history...
540
541
        function mysql_ping(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_ping" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_ping" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_ping" is invalid; consider "Mysql_ping" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_ping()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
542
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
543
            return mysqli_ping(\Dshafik\MySQL::getConnection($link));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
544
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_ping()
Loading history...
545
546
        function mysql_get_client_info(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_get_client_info" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_get_client_info" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_get_client_info" is invalid; consider "Mysql_Get_Client_info" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_get_client_info()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
547
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
548
            return mysqli_get_client_info(\Dshafik\MySQL::getConnection($link));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
549
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_get_client_info()
Loading history...
550
551
        function mysql_get_host_info(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_get_host_info" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_get_host_info" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_get_host_info" is invalid; consider "Mysql_Get_Host_info" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_get_host_info()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
552
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
553
            return mysqli_get_host_info(\Dshafik\MySQL::getConnection($link));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
554
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_get_host_info()
Loading history...
555
556
        function mysql_get_proto_info(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_get_proto_info" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_get_proto_info" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_get_proto_info" is invalid; consider "Mysql_Get_Proto_info" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_get_proto_info()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
557
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
558
            return mysqli_get_proto_info(\Dshafik\MySQL::getConnection($link));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
559
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_get_proto_info()
Loading history...
560
561
        function mysql_get_server_info(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_get_server_info" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_get_server_info" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_get_server_info" is invalid; consider "Mysql_Get_Server_info" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_get_server_info()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
562
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
563
            return mysqli_get_server_info(\Dshafik\MySQL::getConnection($link));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
564
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_get_server_info()
Loading history...
565
566
        function mysql_info(\mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_info" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_info" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_info" is invalid; consider "Mysql_info" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_info()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
567
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
568
            return mysqli_info(\Dshafik\MySQL::getConnection($link));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
569
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_info()
Loading history...
570
571
        function mysql_set_charset($charset, \mysqli $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_set_charset" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_set_charset" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_set_charset" is invalid; consider "Mysql_Set_charset" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_set_charset()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
572
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
573
            return mysqli_set_charset(\Dshafik\MySQL::getConnection($link), $charset);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
574
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_set_charset()
Loading history...
575
576
        function mysql_db_name($result, $row, $field = 0)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_db_name" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_db_name" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_db_name" is invalid; consider "Mysql_Db_name" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_db_name()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
577
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
578 2
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
579
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
580
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
581
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
582
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
583
584
            // Alias as per https://github.com/php/php-src/blob/PHP-5.6/ext/mysql/php_mysql.c#L319
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
585 1
            return mysql_result($result, $row, $field);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
586
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_db_name()
Loading history...
587
588
        function mysql_tablename($result, $row)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_tablename" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_tablename" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_tablename" is invalid; consider "Mysql_tablename" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_tablename()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
589
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
590 1
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
introduced by
Namespaced classes/interfaces/traits should be referenced with use statements
Loading history...
591
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
592
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
593
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
594
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
595
596
            // Alias as per http://lxr.php.net/xref/PHP_5_6/ext/mysql/php_mysql.c#321
0 ignored issues
show
introduced by
Line exceeds 80 characters; contains 85 characters
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
597
            return mysql_result($result, $row, 'Table');
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
598
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_tablename()
Loading history...
599
600
        /* Aliases */
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
601
602
        function mysql_fieldname($result, $field)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_fieldname" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_fieldname" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_fieldname" is invalid; consider "Mysql_fieldname" instead
Loading history...
Coding Style introduced by
You must use "/**" style comments for a function comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
603
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
604
            return mysql_field_name($result, $field);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
605
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fieldname()
Loading history...
606
607
        function mysql_fieldtable($result, $field)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_fieldtable" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_fieldtable" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_fieldtable" is invalid; consider "Mysql_fieldtable" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_fieldtable()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
608
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
609
            return mysql_field_table($result, $field);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
610
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fieldtable()
Loading history...
611
612
        function mysql_fieldlen($result, $field)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_fieldlen" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_fieldlen" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_fieldlen" is invalid; consider "Mysql_fieldlen" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_fieldlen()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
613
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
614
            return mysql_field_len($result, $field);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
615
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fieldlen()
Loading history...
616
617
        function mysql_fieldtype($result, $field)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_fieldtype" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_fieldtype" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_fieldtype" is invalid; consider "Mysql_fieldtype" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_fieldtype()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
618
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
619
            return mysql_field_type($result, $field);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
620
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fieldtype()
Loading history...
621
622
        function mysql_fieldflags($result, $field)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_fieldflags" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_fieldflags" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_fieldflags" is invalid; consider "Mysql_fieldflags" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_fieldflags()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
623
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
624
            return mysql_field_flags($result, $field);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
625
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fieldflags()
Loading history...
626
627
        function mysql_selectdb($databaseName, $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_selectdb" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_selectdb" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_selectdb" is invalid; consider "Mysql_selectdb" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_selectdb()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
628
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
629
            return mysql_select_db($databaseName, $link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
630
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_selectdb()
Loading history...
631
632
        function mysql_freeresult($result)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_freeresult" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_freeresult" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_freeresult" is invalid; consider "Mysql_freeresult" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_freeresult()
Loading history...
introduced by
Missing function doc comment
Loading history...
633
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
634
            return mysql_free_result($result);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
635
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_freeresult()
Loading history...
636
637
        function mysql_numfields($result)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_numfields" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_numfields" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_numfields" is invalid; consider "Mysql_numfields" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_numfields()
Loading history...
introduced by
Missing function doc comment
Loading history...
638
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
639
            return mysql_num_fields($result);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
640
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_numfields()
Loading history...
641
642
        function mysql_numrows($result)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_numrows" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_numrows" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_numrows" is invalid; consider "Mysql_numrows" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_numrows()
Loading history...
introduced by
Missing function doc comment
Loading history...
643
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
644
            return mysql_num_rows($result);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
645
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_numrows()
Loading history...
646
647
        function mysql_listdbs($link)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_listdbs" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_listdbs" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_listdbs" is invalid; consider "Mysql_listdbs" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_listdbs()
Loading history...
introduced by
Missing function doc comment
Loading history...
648
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
649
            return mysql_list_dbs($link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
650
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_listdbs()
Loading history...
651
652
        function mysql_listtables($databaseName, $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_listtables" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_listtables" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_listtables" is invalid; consider "Mysql_listtables" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_listtables()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
653
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
654
            return mysql_list_tables($databaseName, $link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
655
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_listtables()
Loading history...
656
657
        function mysql_listfields($databaseName, $tableName, $link = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_listfields" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_listfields" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_listfields" is invalid; consider "Mysql_listfields" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_listfields()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
658
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
659
            return mysql_list_fields($databaseName, $tableName, $link);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
660
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_listfields()
Loading history...
661
662
        function mysql_dbname($result, $row, $field = 0)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_dbname" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_dbname" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_dbname" is invalid; consider "Mysql_dbname" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_dbname()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
663
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
664
            return mysql_db_name($result, $row, $field);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
mysql_db_name() is a function name alias, use mysql_result() instead
Loading history...
665
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_dbname()
Loading history...
666
667
        function mysql_table_name($result, $row)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Function name "mysql_table_name" is not in camel caps format
Loading history...
Coding Style introduced by
Function name "mysql_table_name" is prefixed with a package name but does not begin with a capital letter
Loading history...
Coding Style introduced by
Function name "mysql_table_name" is invalid; consider "Mysql_Table_name" instead
Loading history...
Coding Style introduced by
Missing doc comment for function mysql_table_name()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
668
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
669
            return mysql_tablename($result, $row);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
mysql_tablename() is a function name alias, use mysql_result() instead
Loading history...
670
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line after function; 0 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_table_name()
Loading history...
671
    }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
Coding Style introduced by
End comment for long condition not found; expected "//end if"
Loading history...
672
}
673
674
namespace Dshafik {
675
676
    class MySQL
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
Coding Style Documentation introduced by
Missing doc comment for class MySQL
Loading history...
Coding Style introduced by
Class name doesn't match filename; expected "class mysql"
Loading history...
Coding Style introduced by
Expected 0 spaces before class keyword; 4 found
Loading history...
introduced by
Missing class doc comment
Loading history...
677
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class MySQL
Loading history...
introduced by
Opening brace should be on the same line as the declaration
Loading history...
678
        public static $last_connection = null;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line(s) before first member var; 0 found
Loading history...
Coding Style introduced by
Member variable "last_connection" is not in valid camel caps format
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
introduced by
Class property $last_connection should use lowerCamel naming without underscores
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
679
        public static $connections = array();
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line(s) before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
680
681 89
        public static function getConnection($link = null, $func = null)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Missing doc comment for function getConnection()
Loading history...
introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
682
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
683 89
            if ($link !== null) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
684 9
                return $link;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
685
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
686
687 89
            if (static::$last_connection === null) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Variable "last_connection" is not in valid camel caps format
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
688 28
                $err = 'A link to the server could not be established';
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
689 28
                if ($func !== null) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
690 28
                    $err = $func . '(): no MySQL-Link resource supplied';
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
691
                }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
692 28
                trigger_error($err, E_USER_WARNING);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
693 28
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
694
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
695
696 62
            return static::$last_connection;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Variable "last_connection" is not in valid camel caps format
Loading history...
697
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end getConnection()
Loading history...
698
699 7
        public static function mysqlFieldInfo(\mysqli_result $result, $field, $what)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Missing doc comment for function mysqlFieldInfo()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
700
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
701
            try {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
702 7
                $field = mysqli_fetch_field_direct($result, $field);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
703 5
            } catch (\Exception $e) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
introduced by
Expected newline after closing brace
Loading history...
704 5
                trigger_error(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
705 5
                    sprintf(
706 5
                        'mysql_field_%s(): Field %d is invalid for MySQL result index %s',
707 5
                        ($what !== 'length') ? $what : 'len',
0 ignored issues
show
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
708
                        $field,
709 5
                        spl_object_hash($result)
710
                    ),
711 5
                    E_USER_WARNING
712
                );
713
                // @codeCoverageIgnoreStart
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
714
                // PHPUnit turns the warning into an exception, so this never runs
0 ignored issues
show
introduced by
Line exceeds 80 characters; contains 82 characters
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
715
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
716
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
717
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
718
719 2
            if ($what === 'type') {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
720 2
                return static::getFieldType($field->type);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
721
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
722
723 2
            if ($what === 'flags') {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
724 2
                return static::getFieldFlags($field->flags);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
725
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
726
727 2
            if (isset($field->{$what})) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
728 2
                return $field->{$what};
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
729
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
730
731
            return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
732
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysqlFieldInfo()
Loading history...
733
734 60
        public static function checkValidResult($result, $function)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Missing doc comment for function checkValidResult()
Loading history...
introduced by
Missing function doc comment
Loading history...
735
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
736 60
            if (!($result instanceof \mysqli_result)) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
737 22
                $type = strtolower(gettype($result));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 11 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
738 22
                $file = "";
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style Comprehensibility introduced by
The string literal does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 11 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
739 22
                $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
740 22
                $backtraceIndex = 0;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
741
742
                /**
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
Loading history...
Coding Style introduced by
Block comments must be started with /*
Loading history...
743
                 * Iterate through backtrace until finding a backtrace with an origin
0 ignored issues
show
introduced by
Line exceeds 80 characters; contains 85 characters
Loading history...
744
                 * Some methods may not leave file and line metadata like call_user_func_array and __call
0 ignored issues
show
introduced by
Line exceeds 80 characters; contains 105 characters
Loading history...
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 105 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
745
                 */
746
                do {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
747 22
                    $currentBacktrace = $backtrace[$backtraceIndex];
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
748 22
                    $callerHasFileAndLine = isset($currentBacktrace['file'], $currentBacktrace['line']);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 104 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
749
750 22
                    if ($callerHasFileAndLine && $currentBacktrace['file'] != __FILE__) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
Coding Style introduced by
Operator != prohibited; use !== instead
Loading history...
751 22
                        $file = $currentBacktrace['file'] . ':' . $currentBacktrace['line'];
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 24
Loading history...
752
                    }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
753 22
                } while ($backtraceIndex++ < count($backtrace) && $file == "");
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style Performance introduced by
The use of count() inside a loop condition is not allowed; assign the return value to a variable and use the variable in the loop condition instead
Loading history...
Coding Style introduced by
Operator == prohibited; use === instead
Loading history...
Coding Style Comprehensibility introduced by
The string literal does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
754
755 22
                if ($function !== 'mysql_fetch_object') {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
756 21
                    trigger_error(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
757 21
                        "$function() expects parameter 1 to be resource, $type given on $file",
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $function instead of interpolation.

It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.

// Instead of
$x = "foo $bar $baz";

// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $type instead of interpolation.

It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.

// Instead of
$x = "foo $bar $baz";

// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $file instead of interpolation.

It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.

// Instead of
$x = "foo $bar $baz";

// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
758 21
                        E_USER_WARNING
759
                    );
760
                }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
761
762 1
                if ($function === 'mysql_fetch_object') {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
763 1
                    trigger_error(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
764 1
                        "$function(): supplied argument is not a valid MySQL result resource on $file",
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $function instead of interpolation.

It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.

// Instead of
$x = "foo $bar $baz";

// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $file instead of interpolation.

It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.

// Instead of
$x = "foo $bar $baz";

// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 103 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
765 1
                        E_USER_WARNING
766
                    );
767
                }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
768
                return false;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
769
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
End comment for long condition not found; expected "//end if"
Loading history...
770
771 38
            return true;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
772
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end checkValidResult()
Loading history...
773
774 1
        public static function escapeString($unescapedString)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Missing doc comment for function escapeString()
Loading history...
introduced by
Missing function doc comment
Loading history...
775
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
776 1
            $escapedString = '';
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
777 1
            for ($i = 0, $max = strlen($unescapedString); $i < $max; $i++) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
778 1
                $escapedString .= self::escapeChar($unescapedString[$i]);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
779
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
780
781 1
            return $escapedString;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
782
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end escapeString()
Loading history...
783
784 2
        protected static function getFieldFlags($what)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Missing doc comment for function getFieldFlags()
Loading history...
introduced by
Missing function doc comment
Loading history...
785
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
786
            // Order of flags taken from http://lxr.php.net/xref/PHP_5_6/ext/mysql/php_mysql.c#2507
0 ignored issues
show
introduced by
Line exceeds 80 characters; contains 99 characters
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
787
            $flags = array(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
788 2
                MYSQLI_NOT_NULL_FLAG => 'not_null',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
789 2
                MYSQLI_PRI_KEY_FLAG => 'primary_key',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
790 2
                MYSQLI_UNIQUE_KEY_FLAG => 'unique_key',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
791 2
                MYSQLI_MULTIPLE_KEY_FLAG => 'multiple_key',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
792 2
                MYSQLI_BLOB_FLAG => 'blob',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
793 2
                MYSQLI_UNSIGNED_FLAG => 'unsigned',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
794 2
                MYSQLI_ZEROFILL_FLAG => 'zerofill',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
795 2
                MYSQLI_BINARY_FLAG => 'binary',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
796 2
                MYSQLI_ENUM_FLAG => 'enum',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
797 2
                MYSQLI_SET_FLAG => 'set',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
798 2
                MYSQLI_AUTO_INCREMENT_FLAG => 'auto_increment',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
799 2
                MYSQLI_TIMESTAMP_FLAG => 'timestamp',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
800
            );
801
802 2
            $fieldFlags = array();
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
803 2
            foreach ($flags as $flag => $value) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
804 2
                if ($what & $flag) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
Coding Style introduced by
Operation must be bracketed
Loading history...
805 2
                    $fieldFlags[] = $value;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
806
                }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
807
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
808
809 2
            return implode(' ', $fieldFlags);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
810
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end getFieldFlags()
Loading history...
811
812 2
        protected static function getFieldType($what)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Missing doc comment for function getFieldType()
Loading history...
introduced by
Missing function doc comment
Loading history...
813
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
814
            $types = array(
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
815 2
                MYSQLI_TYPE_STRING => 'string',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
816 2
                MYSQLI_TYPE_VAR_STRING => 'string',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
817 2
                MYSQLI_TYPE_ENUM => 'string',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
818 2
                MYSQLI_TYPE_SET => 'string',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
819
820 2
                MYSQLI_TYPE_LONG => 'int',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
821 2
                MYSQLI_TYPE_TINY => 'int',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
822 2
                MYSQLI_TYPE_SHORT => 'int',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
823 2
                MYSQLI_TYPE_INT24 => 'int',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
824 2
                MYSQLI_TYPE_CHAR => 'int',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
825 2
                MYSQLI_TYPE_LONGLONG => 'int',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
826
827 2
                MYSQLI_TYPE_DECIMAL => 'real',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
828 2
                MYSQLI_TYPE_FLOAT => 'real',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
829 2
                MYSQLI_TYPE_DOUBLE => 'real',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
830 2
                MYSQLI_TYPE_NEWDECIMAL => 'real',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
831
832 2
                MYSQLI_TYPE_TINY_BLOB => 'blob',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
833 2
                MYSQLI_TYPE_MEDIUM_BLOB => 'blob',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
834 2
                MYSQLI_TYPE_LONG_BLOB => 'blob',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
835 2
                MYSQLI_TYPE_BLOB => 'blob',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
836
837 2
                MYSQLI_TYPE_NEWDATE => 'date',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
838 2
                MYSQLI_TYPE_DATE => 'date',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
839 2
                MYSQLI_TYPE_TIME => 'time',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
840 2
                MYSQLI_TYPE_YEAR => 'year',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
841 2
                MYSQLI_TYPE_DATETIME => 'datetime',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
842 2
                MYSQLI_TYPE_TIMESTAMP => 'timestamp',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
843
844 2
                MYSQLI_TYPE_NULL => 'null',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
845
846 2
                MYSQLI_TYPE_GEOMETRY => 'geometry',
0 ignored issues
show
introduced by
Array indentation error, expected 14 spaces but found 16
Loading history...
847
            );
848
849 2
            return isset($types[$what]) ? $types[$what] : 'unknown';
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
850
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end getFieldType()
Loading history...
851
852 1
        protected static function escapeChar($char)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Missing doc comment for function escapeChar()
Loading history...
introduced by
Missing function doc comment
Loading history...
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
853
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
854 1
            switch ($char) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
855 1
                case "\0":
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
856 1
                    $esc = "\\0";
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
857 1
                    break;
0 ignored issues
show
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
introduced by
Case breaking statement indented incorrectly; expected 18 spaces, found 20
Loading history...
858 1
                case "\n":
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
859 1
                    $esc = "\\n";
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
860 1
                    break;
0 ignored issues
show
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
introduced by
Case breaking statement indented incorrectly; expected 18 spaces, found 20
Loading history...
861 1
                case "\r":
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
862 1
                    $esc = "\\r";
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
863 1
                    break;
0 ignored issues
show
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
introduced by
Case breaking statement indented incorrectly; expected 18 spaces, found 20
Loading history...
864 1
                case '\\':
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
865 1
                case '\'':
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
866 1
                case '"':
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
867 1
                    $esc = "\\{$char}";
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $char instead of interpolation.

It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.

// Instead of
$x = "foo $bar $baz";

// Better use either
$x = "foo " . $bar . " " . $baz;
$x = sprintf("foo %s %s", $bar, $baz);
Loading history...
868 1
                    break;
0 ignored issues
show
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
introduced by
Case breaking statement indented incorrectly; expected 18 spaces, found 20
Loading history...
869 1
                case "\032":
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
870 1
                    $esc = "\\Z";
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
Coding Style Comprehensibility introduced by
The string literal \\Z does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
871 1
                    break;
0 ignored issues
show
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
introduced by
Case breaking statement indented incorrectly; expected 18 spaces, found 20
Loading history...
872
                default:
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 16
Loading history...
873 1
                    $esc = $char;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 10 spaces, found 20
Loading history...
874 1
                    break;
0 ignored issues
show
introduced by
Case breaking statement indented incorrectly; expected 18 spaces, found 20
Loading history...
875
            }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
Coding Style introduced by
End comment for long condition not found; expected "//end switch"
Loading history...
876
877 1
            return $esc;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 6 spaces, found 12
Loading history...
878
        }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 8
Loading history...
Coding Style introduced by
Expected 1 blank line after function; 0 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end escapeChar()
Loading history...
879
    }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 2 spaces, found 4
Loading history...
Coding Style introduced by
Expected //end class
Loading history...
Coding Style introduced by
Expected 0 spaces before closing brace; 4 found
Loading history...
Coding Style introduced by
Closing brace of a class must be followed by a single blank line; found 0
Loading history...
880
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
881