Passed
Pull Request — master (#56)
by Davey
21:35
created

mysql.php ➔ mysql_fetch_field()   F

Complexity

Conditions 42
Paths > 20000

Size

Total Lines 129

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 33
CRAP Score 46.0203

Importance

Changes 0
Metric Value
cc 42
nc 20743
nop 2
dl 0
loc 129
ccs 33
cts 38
cp 0.8684
crap 46.0203
rs 0
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...
2
/**
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
Expected 1 space(s) after NOT operator; 0 found
Loading history...
24
        if (!extension_loaded('mysqli')) {
0 ignored issues
show
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);
26
        }
27
28
        define('MYSQL_ASSOC', 1);
29
        define('MYSQL_NUM', 2);
30
        define('MYSQL_BOTH', 3);
31
        define('MYSQL_CLIENT_COMPRESS', 32);
32
        define('MYSQL_CLIENT_SSL', 2048);
33
        define('MYSQL_CLIENT_INTERACTIVE', 1024);
34
        define('MYSQL_CLIENT_IGNORE_SPACE', 256);
35
36
        function mysql_connect(
0 ignored issues
show
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...
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...
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
Coding Style introduced by
function mysql_connect() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
Coding Style introduced by
Incorrect spacing between argument "$hostname" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$hostname"; expected 0 but found 1
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...
Coding Style introduced by
Incorrect spacing between argument "$username" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$username"; expected 0 but found 1
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...
Coding Style introduced by
Incorrect spacing between argument "$password" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$password"; expected 0 but found 1
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...
Coding Style introduced by
Incorrect spacing between argument "$new" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$new"; expected 0 but found 1
Loading history...
41
            $flags = 0
0 ignored issues
show
Coding Style introduced by
Incorrect spacing between argument "$flags" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$flags"; expected 0 but found 1
Loading history...
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
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);
45
            }
46
47 64
            if (null === $hostname) {
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...
48 1
                $hostname = ini_get('mysqli.default_host') ?: null;
0 ignored issues
show
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...
Coding Style introduced by
Consider using a different name than the parameter $hostname. This often makes code more readable.
Loading history...
49
            }
0 ignored issues
show
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
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
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...
Coding Style introduced by
Consider using a different name than the parameter $username. This often makes code more readable.
Loading history...
52
            }
0 ignored issues
show
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
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
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...
Coding Style introduced by
Consider using a different name than the parameter $password. This often makes code more readable.
Loading history...
55
            }
56
57 64
            $socket = '';
58 64
            if (strpos($hostname, ':/') === 0) {
59
                // it's a unix socket
0 ignored issues
show
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...
60
                $socket = $hostname;
0 ignored issues
show
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
Consider using a different name than the parameter $hostname. This often makes code more readable.
Loading history...
62
            }
63
64 64
            $hash = sha1($hostname . $username . $flags);
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
65
            /* persistent connections start with p: */
0 ignored issues
show
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
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
67 64
            if ($hostname[1] !== ':' && isset(\Dshafik\MySQL::$connections[$hash])) {
68 10
                \Dshafik\MySQL::$last_connection = \Dshafik\MySQL::$connections[$hash]['conn'];
0 ignored issues
show
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;
70 10
                return \Dshafik\MySQL::$connections[$hash]['conn'];
71
            }
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
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
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...
Coding Style introduced by
$port_matches does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
75
                $hostname = $port_matches[1];
0 ignored issues
show
Coding Style introduced by
Variable "port_matches" is not in valid camel caps format
Loading history...
Coding Style introduced by
$port_matches does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
Coding Style introduced by
Consider using a different name than the parameter $hostname. This often makes code more readable.
Loading history...
76
                $port = (int) $port_matches[2];
0 ignored issues
show
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...
Coding Style introduced by
$port_matches does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
77
            } else {
78 55
                $port = 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...
79
            }
80
81
            /* No flags, means we can use mysqli_connect() */
0 ignored issues
show
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
82 55
            if ($flags === 0) {
83 53
                $conn = mysqli_connect($hostname, $username, $password, '', $port);
84 52
                if (!$conn instanceof mysqli) {
0 ignored issues
show
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
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
No blank line found after control structure
Loading history...
87 51
                \Dshafik\MySQL::$last_connection = $conn;
0 ignored issues
show
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
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
Short array syntax must be used to define arrays
Loading history...
Coding Style introduced by
Arrays with multiple values should not be declared on a single line.
Loading history...
90
91 51
                return $conn;
92
            }
93
94
            /* Flags means we need to use mysqli_real_connect() instead, and handle exceptions */
0 ignored issues
show
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
95
            try {
96 2
                \Dshafik\MySQL::$last_connection = $conn = mysqli_init();
0 ignored issues
show
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(
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
110
                // PHPUnit turns the warning from mysqli_real_connect into an exception, so this never runs
0 ignored issues
show
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...
111
                if ($conn === 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...
112
                    return 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...
113
                }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
114
                // @codeCoverageIgnoreEnd
0 ignored issues
show
Coding Style introduced by
There should be no blank line after an inline comment.
Loading history...
115
116 1
                $conn->hash = $hash;
0 ignored issues
show
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
Short array syntax must be used to define arrays
Loading history...
Coding Style introduced by
Arrays with multiple values should not be declared on a single line.
Loading history...
118
119 1
                return $conn;
120 1
            } catch (\Throwable $e) {
121 1
                trigger_error($e->getMessage(), E_USER_WARNING);
122
                // @codeCoverageIgnoreStart
123
                // PHPUnit turns the warning into an exception, so this never runs
124
                return 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...
125
                // @codeCoverageIgnoreEnd
126
            }
0 ignored issues
show
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
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_connect()
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
128
129
        function mysql_pconnect(
0 ignored issues
show
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...
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...
Coding Style introduced by
function mysql_pconnect() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
Coding Style introduced by
Incorrect spacing between argument "$hostname" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$hostname"; expected 0 but found 1
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...
Coding Style introduced by
Incorrect spacing between argument "$username" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$username"; expected 0 but found 1
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...
Coding Style introduced by
Incorrect spacing between argument "$password" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$password"; expected 0 but found 1
Loading history...
133
            $flags = 0
0 ignored issues
show
Coding Style introduced by
Incorrect spacing between argument "$flags" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$flags"; expected 0 but found 1
Loading history...
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
Concat operator must not be surrounded by spaces
Loading history...
Coding Style introduced by
Consider using a different name than the parameter $hostname. This often makes code more readable.
Loading history...
136 1
            return mysql_connect($hostname, $username, $password, false, $flags);
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...
137
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
138
139
        function mysql_close(\mysqli $link = null)
0 ignored issues
show
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...
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
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_close() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
Coding Style introduced by
function mysql_close() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
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
Consider using a different name than the parameter $link. This often makes code more readable.
Loading history...
144 89
            if ($link === 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...
145
                // @codeCoverageIgnoreStart
146
                // PHPUnit Warning -> Exception
147
                return 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...
148
                // @codeCoverageIgnoreEnd
149
            }
150
151 89
            if (isset(\Dshafik\MySQL::$connections[$link->hash])) {
152 61
                \Dshafik\MySQL::$connections[$link->hash]['refcount'] -= 1;
153
            }
154
155 89
            $return = true;
0 ignored issues
show
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) {
157 52
                $return = mysqli_close($link);
158 52
                unset(\Dshafik\MySQL::$connections[$link->hash]);
159
            }
160
161 89
            if ($isDefault) {
162 89
                Dshafik\MySQL::$last_connection = null;
0 ignored issues
show
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
            }
164
165 89
            return $return;
166
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
167
168
        function mysql_select_db($databaseName, \mysqli $link = null)
0 ignored issues
show
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...
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
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_select_db() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
Coding Style introduced by
function mysql_select_db() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
Consider using a different name than the parameter $link. This often makes code more readable.
Loading history...
171
172 54
            return mysqli_query(
173 54
                $link,
174 54
                'USE `' . mysqli_real_escape_string($link, $databaseName) . '`'
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
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
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_select_db()
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
177
178
        function mysql_query($query, \mysqli $link = null)
0 ignored issues
show
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...
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
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_query() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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);
181
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
182
183
        function mysql_unbuffered_query($query, \mysqli $link = null)
0 ignored issues
show
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...
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
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_unbuffered_query() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
Consider using a different name than the parameter $link. This often makes code more readable.
Loading history...
186 4
            if (mysqli_real_query($link, $query)) {
187 3
                return mysqli_use_result($link);
188
            }
189
190 1
            return 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...
191
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
192
193
        function mysql_db_query($databaseName, $query, \mysqli $link = null)
0 ignored issues
show
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...
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
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_db_query() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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)) {
196 1
                return mysql_query($query, $link);
197
            }
0 ignored issues
show
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
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
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_db_query()
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
200
201
        function mysql_list_dbs(\mysqli $link = null)
0 ignored issues
show
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...
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
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_list_dbs() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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);
204
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
205
206
        function mysql_list_tables($databaseName, \mysqli $link = null)
0 ignored issues
show
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...
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
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_list_tables() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
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
Consider using a different name than the parameter $link. This often makes code more readable.
Loading history...
209 3
            $query = sprintf(
210 3
                'SHOW TABLES FROM `%s`',
211 3
                mysql_real_escape_string($databaseName, $link)
212
            );
213 3
            return mysql_query($query, $link);
214
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
215
216
        function mysql_list_fields($databaseName, $tableName, \mysqli $link = null)
0 ignored issues
show
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...
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
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_list_fields() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
Consider using a different name than the parameter $link. This often makes code more readable.
Loading history...
219
220 3
            $query = sprintf(
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);
227
228 3
            if ($result instanceof \mysqli_result) {
229 2
                $result->table = $tableName;
230 2
                return $result;
231
            }
232
233 1
            trigger_error('mysql_list_fields(): Unable to save MySQL query result', E_USER_WARNING);
234
            // @codeCoverageIgnoreStart
235
            return 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...
236
            // @codeCoverageIgnoreEnd
237
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
238
239
        function mysql_list_processes(\mysqli $link = null)
0 ignored issues
show
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...
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
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_list_processes() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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);
242
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
243
244
        function mysql_error(\mysqli $link = null)
0 ignored issues
show
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...
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
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_error() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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));
247
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
248
249
        function mysql_errno(\mysqli $link = null)
0 ignored issues
show
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...
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
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_errno() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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));
252
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
253
254
        function mysql_affected_rows(\mysqli $link = null)
0 ignored issues
show
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...
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
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_affected_rows() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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));
257
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
258
259
        function mysql_insert_id($link = null) /*|*/
0 ignored issues
show
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...
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_insert_id() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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));
262
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
263
264
        function mysql_result($result, $row, $field = 0)
0 ignored issues
show
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...
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...
Coding Style introduced by
Incorrect spacing between argument "$field" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$field"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_result() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
Expected 1 space(s) after NOT operator; 0 found
Loading history...
267
                // @codeCoverageIgnoreStart
268
                return 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...
269
                // @codeCoverageIgnoreEnd
270
            }
271
272 7
            if (!mysqli_data_seek($result, $row)) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
273 1
                trigger_error(
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
282
                return 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...
283
                // @codeCoverageIgnoreEnd
284
            }
285
286 6
            $found = true;
0 ignored issues
show
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
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);
289 3
                $i = 0;
0 ignored issues
show
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
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);
292 3
                while ($column = mysqli_fetch_field($result)) {
0 ignored issues
show
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) {
294 2
                        $field = $i;
0 ignored issues
show
Coding Style introduced by
Consider using a different name than the parameter $field. This often makes code more readable.
Loading history...
295 2
                        $found = true;
0 ignored issues
show
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;
297
                    }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
298 3
                    $i++;
299
                }
300
            }
301
302 6
            $row = mysql_fetch_array($result);
0 ignored issues
show
Coding Style introduced by
Consider using a different name than the parameter $row. This often makes code more readable.
Loading history...
303 6
            if ($found && array_key_exists($field, $row)) {
304 4
                return $row[$field];
305
            }
306
307 2
            trigger_error(
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
317
            return 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...
318
            // @codeCoverageIgnoreEnd
319
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
320
321
        function mysql_num_rows($result)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_num_rows() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
Expected 1 space(s) after NOT operator; 0 found
Loading history...
324
                // @codeCoverageIgnoreStart
325
                return 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...
326
                // @codeCoverageIgnoreEnd
327
            }
328
329 13
            $previous = error_reporting(0);
330 13
            $rows = mysqli_num_rows($result);
0 ignored issues
show
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);
332
333 13
            return $rows;
334
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
335
336
        function mysql_num_fields($result)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_num_fields() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
Expected 1 space(s) after NOT operator; 0 found
Loading history...
339
                // @codeCoverageIgnoreStart
340
                return 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...
341
                // @codeCoverageIgnoreEnd
342
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
343 1
            return mysqli_num_fields($result);
344
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
345
346
        function mysql_fetch_row($result)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_fetch_row() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
Expected 1 space(s) after NOT operator; 0 found
Loading history...
349
                // @codeCoverageIgnoreStart
350
                return 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...
351
                // @codeCoverageIgnoreEnd
352
            }
0 ignored issues
show
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
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
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fetch_row()
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
355
356
        function mysql_fetch_array($result, $resultType = MYSQL_BOTH)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$resultType" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$resultType"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_fetch_array() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
Expected 1 space(s) after NOT operator; 0 found
Loading history...
359
                // @codeCoverageIgnoreStart
360
                return 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...
361
                // @codeCoverageIgnoreEnd
362
            }
0 ignored issues
show
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
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
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fetch_array()
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
365
366
        function mysql_fetch_assoc($result) /* : array|null */
0 ignored issues
show
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...
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...
Coding Style introduced by
function mysql_fetch_assoc() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
Expected 1 space(s) after NOT operator; 0 found
Loading history...
369
                // @codeCoverageIgnoreStart
370
                return 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...
371
                // @codeCoverageIgnoreEnd
372
            }
373
374 8
            return mysqli_fetch_assoc($result) ?: false;
0 ignored issues
show
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
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fetch_assoc()
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
376
377
        function mysql_fetch_object($result, $class = null, array $params = array()) /* : object|null */
0 ignored issues
show
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...
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...
Coding Style introduced by
Incorrect spacing between argument "$class" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$class"; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between argument "$params" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$params"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_fetch_object() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
Expected 1 space(s) after NOT operator; 0 found
Loading history...
380
                // @codeCoverageIgnoreStart
381
                return 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...
382
                // @codeCoverageIgnoreEnd
383
            }
384
385 2
            if ($class === 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...
386 2
                $object = mysqli_fetch_object($result);
387
            } else {
388
                $object = mysqli_fetch_object($result, $class, $params);
389
            }
390
391 2
            return $object ?: false;
0 ignored issues
show
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
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end mysql_fetch_object()
Loading history...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
393
394
        function mysql_data_seek($result, $offset)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_data_seek() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
Coding Style introduced by
function mysql_data_seek() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
Expected 1 space(s) after NOT operator; 0 found
Loading history...
397
                // @codeCoverageIgnoreStart
398
                return 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...
399
                // @codeCoverageIgnoreEnd
400
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
401
            return mysqli_data_seek($result, $offset);
402
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
403
404
        function mysql_fetch_lengths($result) /* : array|*/
0 ignored issues
show
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...
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...
Coding Style introduced by
function mysql_fetch_lengths() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
Expected 1 space(s) after NOT operator; 0 found
Loading history...
407
                // @codeCoverageIgnoreStart
408
                return 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...
409
                // @codeCoverageIgnoreEnd
410
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
411
            return mysqli_fetch_lengths($result);
412
        }
0 ignored issues
show
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...
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
413
414
        function mysql_fetch_field($result, $field_offset = null) /* : object|*/
0 ignored issues
show
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...
Coding Style introduced by
Variable "field_offset" is not in valid camel caps format
Loading history...
Coding Style introduced by
Incorrect spacing between argument "$field_offset" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$field_offset"; expected 0 but found 1
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...
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...
Coding Style introduced by
function mysql_fetch_field() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
Coding Style introduced by
$field_offset does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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
            static $fields = array();
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
417
418
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
419
                // @codeCoverageIgnoreStart
420
                return 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...
421 2
                // @codeCoverageIgnoreEnd
422 2
            }
423 2
424 2
            $result_hash = spl_object_hash($result);
0 ignored issues
show
Coding Style introduced by
Variable "result_hash" is not in valid camel caps format
Loading history...
Coding Style introduced by
$result_hash does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
425 2
            if ($field_offset === null) {
0 ignored issues
show
Coding Style introduced by
Variable "field_offset" 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...
Coding Style introduced by
$field_offset does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
426 2
                $fields[$result_hash][] = true;
0 ignored issues
show
Coding Style introduced by
Variable "result_hash" 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 true please use TRUE.
Loading history...
Coding Style introduced by
$result_hash does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
427 2
                $res = mysqli_fetch_field($result);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 20 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...
428 2
            } elseif ($field_offset > mysqli_num_fields($result)) {
0 ignored issues
show
Coding Style introduced by
Usage of ELSEIF not allowed; use ELSE IF instead
Loading history...
Coding Style introduced by
Variable "field_offset" is not in valid camel caps format
Loading history...
Coding Style introduced by
$field_offset does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
429 2
                trigger_error('mysql_fetch_field(): Bad field offset', E_USER_WARNING);
430 2
                return 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...
431
            } else {
432 2
                $i = 0;
433
                if (isset($fields[$result_hash])) {
0 ignored issues
show
Coding Style introduced by
Variable "result_hash" is not in valid camel caps format
Loading history...
Coding Style introduced by
$result_hash does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
434
                    $i = count($fields[$result_hash]);
0 ignored issues
show
Coding Style introduced by
Variable "result_hash" is not in valid camel caps format
Loading history...
Coding Style introduced by
$result_hash does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
435
                }
436
437 1
                while ($i <= $field_offset) {
0 ignored issues
show
Coding Style introduced by
Variable "field_offset" is not in valid camel caps format
Loading history...
Coding Style introduced by
$field_offset does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
438
                    $res = mysqli_fetch_field($result);
439
440
                    if ($res === 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...
441
                        return 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...
442
                    }
443
444
                    $fields[$result_hash][$i] = true;
0 ignored issues
show
Coding Style introduced by
Variable "result_hash" 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 true please use TRUE.
Loading history...
Coding Style introduced by
$result_hash does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
445
                    $i++;
446
                }  
447 2
            }
0 ignored issues
show
Coding Style introduced by
End comment for long condition not found; expected "//end if"
Loading history...
448
449
            if ($res instanceof \stdClass) {
450
                $res->not_null = ($res->flags & MYSQLI_NOT_NULL_FLAG) ? 1 : 0;
0 ignored issues
show
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...
Bug introduced by
The variable $res does not seem to be defined for all execution paths leading up to this point.

If you define a variable conditionally, it can happen that it is not defined for all execution paths.

Let’s take a look at an example:

function myFunction($a) {
    switch ($a) {
        case 'foo':
            $x = 1;
            break;

        case 'bar':
            $x = 2;
            break;
    }

    // $x is potentially undefined here.
    echo $x;
}

In the above example, the variable $x is defined if you pass “foo” or “bar” as argument for $a. However, since the switch statement has no default case statement, if you pass any other value, the variable $x would be undefined.

Available Fixes

  1. Check for existence of the variable explicitly:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        if (isset($x)) { // Make sure it's always set.
            echo $x;
        }
    }
    
  2. Define a default value for the variable:

    function myFunction($a) {
        $x = ''; // Set a default which gets overridden for certain paths.
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
        }
    
        echo $x;
    }
    
  3. Add a value for the missing path:

    function myFunction($a) {
        switch ($a) {
            case 'foo':
                $x = 1;
                break;
    
            case 'bar':
                $x = 2;
                break;
    
            // We add support for the missing case.
            default:
                $x = '';
                break;
        }
    
        echo $x;
    }
    
Loading history...
451
                $res->primary_key = ($res->flags & MYSQLI_PRI_KEY_FLAG ) ? 1 : 0;
0 ignored issues
show
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...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
452 1
                $res->unique_key = ($res->flags & MYSQLI_UNIQUE_KEY_FLAG ) ? 1 : 0;
0 ignored issues
show
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...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
453
                $res->multiple_key = ($res->flags & MYSQLI_MULTIPLE_KEY_FLAG ) ? 1 : 0;
0 ignored issues
show
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...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
454
                $res->numeric = ($res->flags & MYSQLI_NUM_FLAG ) ? 1 : 0;
0 ignored issues
show
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...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
455
                $res->blob = ($res->flags & MYSQLI_BLOB_FLAG ) ? 1 : 0;
0 ignored issues
show
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...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
456
                $res->unsigned = ($res->flags & MYSQLI_UNSIGNED_FLAG ) ? 1 : 0;
0 ignored issues
show
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...
457 4
                $res->zerofill = ($res->flags & MYSQLI_ZEROFILL_FLAG ) ? 1 : 0;
0 ignored issues
show
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...
458
459
                switch ($res->type) {
0 ignored issues
show
Coding Style introduced by
All SWITCH statements must contain a DEFAULT case
Loading history...
460
                    case MYSQLI_TYPE_CHAR: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
461
                        $res->type = 'tinyint';
462 3
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
463
                    case MYSQLI_TYPE_SHORT: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
464
                        $res->type = 'smallint';
465
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
466
                    case MYSQLI_TYPE_DECIMAL: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
467 4
                        $res->type = 'decimal';
468
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
469
                    case MYSQLI_TYPE_LONG: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
470
                        $res->type = 'int';
471
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
472 3
                    case MYSQLI_TYPE_FLOAT: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
473
                        $res->type = 'float';
474
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
475
                    case MYSQLI_TYPE_DOUBLE: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
476
                        $res->type = 'double';
477 4
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
478
                    case MYSQLI_TYPE_NULL: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
479
                        $res->type = 'null';
480
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
481
                    case MYSQLI_TYPE_TIMESTAMP: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
482 3
                        $res->type = 'timestamp';
483
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
484
                    case MYSQLI_TYPE_LONGLONG: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
485
                        $res->type = 'bigint';
486
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
487 4
                    case MYSQLI_TYPE_INT24: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
488
                        $res->type = 'mediumint';
489
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
490
                    case MYSQLI_TYPE_DATE: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
491
                        $res->type = 'date';
492 3
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
493
                    case MYSQLI_TYPE_TIME: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
494
                        $res->type = 'time';
495
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
496
                    case MYSQLI_TYPE_DATETIME: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
497 4
                        $res->type = 'datetime';
498
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
499
                    case MYSQLI_TYPE_YEAR: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
500
                        $res->type = 'year';
501
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
502 3
                    case MYSQLI_TYPE_NEWDATE: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
503
                        $res->type = 'date';
504
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
505
                    case MYSQLI_TYPE_BIT: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
506
                        $res->type = 'bit';
507 2
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
508 2
                    case MYSQLI_TYPE_ENUM: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
509 2
                        $res->type = 'enum';
510 2
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
511 2
                    case MYSQLI_TYPE_SET: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
512
                        $res->type = 'set';
513 2
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
514
                    case MYSQLI_TYPE_TINY_BLOB: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
515
                        $res->type = 'tinyblob';
516 1
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
517
                    case MYSQLI_TYPE_MEDIUM_BLOB: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
518
                        $res->type = 'mediumblob';
519
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
520
                    case MYSQLI_TYPE_LONG_BLOB: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
521
                        $res->type = 'longblob';
522
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
523 3
                    case MYSQLI_TYPE_BLOB: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
524
                        $res->type = 'blob';
525
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
526
                    case MYSQLI_TYPE_VAR_STRING: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
527
                        $res->type = 'string';
528
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
529
                    case MYSQLI_TYPE_STRING: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
530
                        $res->type = 'string';
531
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
532
                    case MYSQLI_TYPE_GEOMETRY: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
533
                        $res->type = 'geometry';
534
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
535
                    case MYSQLI_TYPE_NEWDECIMAL: 
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 16 spaces, found 20
Loading history...
536
                        $res->type = 'numeric';
537
                        break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
538
                }
0 ignored issues
show
Coding Style introduced by
End comment for long condition not found; expected "//end switch"
Loading history...
539
            }
0 ignored issues
show
Coding Style introduced by
End comment for long condition not found; expected "//end if"
Loading history...
540
541
            return $res;
542
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_fetch_field()
Loading history...
543
544
        function mysql_field_seek($result, $field)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_field_seek() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
Coding Style introduced by
function mysql_field_seek() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
545
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
546
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
547
                // @codeCoverageIgnoreStart
548
                return 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...
549
                // @codeCoverageIgnoreEnd
550
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
551
            return mysqli_field_seek($result, $field);
552
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_field_seek()
Loading history...
553
554
        function mysql_free_result($result)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_free_result() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
Coding Style introduced by
function mysql_free_result() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
555
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
556
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
557
                // @codeCoverageIgnoreStart
558
                return 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...
559
                // @codeCoverageIgnoreEnd
560
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
561
            return mysqli_free_result($result);
562
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_free_result()
Loading history...
563
564 View Code Duplication
        function mysql_field_name($result, $field)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_field_name() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
565
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
566
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
567
                // @codeCoverageIgnoreStart
568
                return 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...
569
                // @codeCoverageIgnoreEnd
570
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
571
            return \Dshafik\MySQL::mysqlFieldInfo($result, $field, 'name');
572
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_field_name()
Loading history...
573
574
        function mysql_field_table($result, $field)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_field_table() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
575
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
576
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
577
                // @codeCoverageIgnoreStart
578 2
                return 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...
579
                // @codeCoverageIgnoreEnd
580
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
581
            return \Dshafik\MySQL::mysqlFieldInfo($result, $field, 'table');
582
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_field_table()
Loading history...
583
584
        function mysql_field_len($result, $field)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_field_len() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
585 1
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
586
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
587
                // @codeCoverageIgnoreStart
588
                return 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...
589
                // @codeCoverageIgnoreEnd
590 1
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
591
            return \Dshafik\MySQL::mysqlFieldInfo($result, $field, 'length');
592
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_field_len()
Loading history...
593
594 View Code Duplication
        function mysql_field_type($result, $field)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_field_type() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
595
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
596
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
597
                // @codeCoverageIgnoreStart
598
                return 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...
599
                // @codeCoverageIgnoreEnd
600
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
601
            return \Dshafik\MySQL::mysqlFieldInfo($result, $field, 'type');
602
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_field_type()
Loading history...
603
604
        function mysql_field_flags($result, $field)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_field_flags() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
605
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
606
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
607
                // @codeCoverageIgnoreStart
608
                return 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...
609
                // @codeCoverageIgnoreEnd
610
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
611
            return \Dshafik\MySQL::mysqlFieldInfo($result, $field, 'flags');
612
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_field_flags()
Loading history...
613
614
        function mysql_escape_string($unescapedString)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_escape_string() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
615
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
616
            if (\Dshafik\MySQL::$last_connection === null) {
0 ignored issues
show
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...
617
                trigger_error(
618
                    sprintf(
619
                        '%s() is insecure; use mysql_real_escape_string() instead!',
620
                        __FUNCTION__
621
                    ),
622
                    E_USER_NOTICE
623
                );
624
625
                return \Dshafik\MySQL::escapeString($unescapedString);
626
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
627
            return mysql_real_escape_string($unescapedString, 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...
628
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_escape_string()
Loading history...
629
630
        function mysql_real_escape_string($unescapedString, \mysqli $link = null)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
function mysql_real_escape_string() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
631
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
632
            return mysqli_escape_string(\Dshafik\MySQL::getConnection($link), $unescapedString);
633
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_real_escape_string()
Loading history...
634
635
        function mysql_stat(\mysqli $link = null)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
function mysql_stat() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
636
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
637
            return mysqli_stat(\Dshafik\MySQL::getConnection($link));
638
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_stat()
Loading history...
639
640
        function mysql_thread_id(\mysqli $link = null)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
function mysql_thread_id() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
641
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
642
            return mysqli_thread_id(\Dshafik\MySQL::getConnection($link));
643
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_thread_id()
Loading history...
644
645
        function mysql_client_encoding(\mysqli $link = null)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
function mysql_client_encoding() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
646
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
647
            return mysqli_character_set_name(\Dshafik\MySQL::getConnection($link));
648
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_client_encoding()
Loading history...
649
650
        function mysql_ping(\mysqli $link = null)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
function mysql_ping() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
Coding Style introduced by
function mysql_ping() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
651
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
652
            return mysqli_ping(\Dshafik\MySQL::getConnection($link));
653
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_ping()
Loading history...
654
655
        function mysql_get_client_info(\mysqli $link = null)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
function mysql_get_client_info() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
656
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
657
            return mysqli_get_client_info(\Dshafik\MySQL::getConnection($link));
658
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_get_client_info()
Loading history...
659
660
        function mysql_get_host_info(\mysqli $link = null)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
function mysql_get_host_info() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
661
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
662
            return mysqli_get_host_info(\Dshafik\MySQL::getConnection($link));
663
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_get_host_info()
Loading history...
664
665
        function mysql_get_proto_info(\mysqli $link = null)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
function mysql_get_proto_info() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
666
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
667
            return mysqli_get_proto_info(\Dshafik\MySQL::getConnection($link));
668
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_get_proto_info()
Loading history...
669
670
        function mysql_get_server_info(\mysqli $link = null)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
function mysql_get_server_info() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
671
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
672
            return mysqli_get_server_info(\Dshafik\MySQL::getConnection($link));
673
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_get_server_info()
Loading history...
674
675
        function mysql_info(\mysqli $link = null)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
function mysql_info() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
676
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
677
            return mysqli_info(\Dshafik\MySQL::getConnection($link));
678
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_info()
Loading history...
679
680
        function mysql_set_charset($charset, \mysqli $link = null)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
function mysql_set_charset() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
Coding Style introduced by
function mysql_set_charset() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
681 89
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
682
            return mysqli_set_charset(\Dshafik\MySQL::getConnection($link), $charset);
683 89
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_set_charset()
Loading history...
684 9
685
        function mysql_db_name($result, $row, $field = 0)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$field" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$field"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_db_name() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
686
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
687 89
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
688 28
                // @codeCoverageIgnoreStart
689 28
                return 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...
690 28
                // @codeCoverageIgnoreEnd
691
            }
692 28
693 28
            // 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
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
694
            return mysql_result($result, $row, $field);
695
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_db_name()
Loading history...
696 62
697
        function mysql_tablename($result, $row)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_tablename() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
698
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
699 7
            if (!\Dshafik\MySQL::checkValidResult($result, __FUNCTION__)) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
700
                // @codeCoverageIgnoreStart
701
                return 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...
702 7
                // @codeCoverageIgnoreEnd
703 5
            }
704 5
705 5
            // Alias as per http://lxr.php.net/xref/PHP_5_6/ext/mysql/php_mysql.c#321
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
706 5
            return mysql_result($result, $row, 'Table');
707 5
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_tablename()
Loading history...
708
709 5
        /* Aliases */
0 ignored issues
show
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
710
711 5
        function mysql_fieldname($result, $field)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_fieldname() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
712
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
713
            return mysql_field_name($result, $field);
714
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_fieldname()
Loading history...
715
716
        function mysql_fieldtable($result, $field)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_fieldtable() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
717
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
718
            return mysql_field_table($result, $field);
719 2
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_fieldtable()
Loading history...
720 2
721
        function mysql_fieldlen($result, $field)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_fieldlen() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
722
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
723 2
            return mysql_field_len($result, $field);
724 2
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_fieldlen()
Loading history...
725
726
        function mysql_fieldtype($result, $field)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_fieldtype() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
727 2
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
728 2
            return mysql_field_type($result, $field);
729
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_fieldtype()
Loading history...
730
731
        function mysql_fieldflags($result, $field)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_fieldflags() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
732
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
733
            return mysql_field_flags($result, $field);
734 60
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_fieldflags()
Loading history...
735
736 60
        function mysql_selectdb($databaseName, $link = null)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
function mysql_selectdb() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
Coding Style introduced by
function mysql_selectdb() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
737 22
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
738 22
            return mysql_select_db($databaseName, $link);
739 22
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_selectdb()
Loading history...
740 22
741
        function mysql_freeresult($result)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_freeresult() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
Coding Style introduced by
function mysql_freeresult() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
742
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
743
            return mysql_free_result($result);
744
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_freeresult()
Loading history...
745
746
        function mysql_numfields($result)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_numfields() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
747 22
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
748 22
            return mysql_num_fields($result);
749
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_numfields()
Loading history...
750 22
751 22
        function mysql_numrows($result)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_numrows() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
752
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
753 22
            return mysql_num_rows($result);
754
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_numrows()
Loading history...
755 22
756 21
        function mysql_listdbs($link)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_listdbs() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
757 21
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
758 21
            return mysql_list_dbs($link);
759
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_listdbs()
Loading history...
760
761
        function mysql_listtables($databaseName, $link = null)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
function mysql_listtables() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
762 1
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
763 1
            return mysql_list_tables($databaseName, $link);
764 1
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_listtables()
Loading history...
765 1
766
        function mysql_listfields($databaseName, $tableName, $link = null)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
function mysql_listfields() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
767
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
768
            return mysql_list_fields($databaseName, $tableName, $link);
769
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_listfields()
Loading history...
770
771 38
        function mysql_dbname($result, $row, $field = 0)
0 ignored issues
show
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...
Coding Style introduced by
Incorrect spacing between argument "$field" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$field"; expected 0 but found 1
Loading history...
Coding Style introduced by
function mysql_dbname() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
772
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
773
            return mysql_db_name($result, $row, $field);
774 1
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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_dbname()
Loading history...
775
776 1
        function mysql_table_name($result, $row)
0 ignored issues
show
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...
Coding Style introduced by
function mysql_table_name() does not seem to conform to the naming convention (^(?:[a-z]|__)[a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

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...
777 1
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
778 1
            return mysql_tablename($result, $row);
779
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines 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...
780
    }
0 ignored issues
show
Coding Style introduced by
End comment for long condition not found; expected "//end if"
Loading history...
781 1
}
782
783
namespace Dshafik {
784 2
785
    class MySQL
0 ignored issues
show
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...
Coding Style introduced by
MySQL does not seem to conform to the naming convention (Utils?$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
786
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class MySQL
Loading history...
787
        public static $last_connection = null;
0 ignored issues
show
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...
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
$last_connection does not seem to conform to the naming convention (^[a-z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
788 2
        public static $connections = array();
0 ignored issues
show
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...
789 2
790 2
        public static function getConnection($link = null, $func = null)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
Coding Style introduced by
Missing doc comment for function getConnection()
Loading history...
Coding Style introduced by
Incorrect spacing between argument "$link" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$link"; expected 0 but found 1
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
Incorrect spacing between argument "$func" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$func"; expected 0 but found 1
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...
791 2
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
792 2
            if ($link !== 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...
793 2
                return $link;
794 2
            }
795 2
796 2
            if (static::$last_connection === null) {
0 ignored issues
show
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...
797 2
                $err = 'A link to the server could not be established';
798 2
                if ($func !== 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...
799 2
                    $err = $func . '(): no MySQL-Link resource supplied';
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
800
                }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
801
                trigger_error($err, E_USER_WARNING);
802 2
                return 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...
803 2
            }
804 2
805 2
            return static::$last_connection;
0 ignored issues
show
Coding Style introduced by
Variable "last_connection" is not in valid camel caps format
Loading history...
806
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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 getConnection()
Loading history...
807
808
        public static function mysqlFieldInfo(\mysqli_result $result, $field, $what)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function mysqlFieldInfo()
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...
809 2
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
810
            try {
811
                $field = mysqli_fetch_field_direct($result, $field);
0 ignored issues
show
Coding Style introduced by
Consider using a different name than the parameter $field. This often makes code more readable.
Loading history...
812 2
            } catch (\Exception $e) {
813
                trigger_error(
814
                    sprintf(
815 2
                        'mysql_field_%s(): Field %d is invalid for MySQL result index %s',
816 2
                        ($what !== 'length') ? $what : 'len',
0 ignored issues
show
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
817 2
                        $field,
818 2
                        spl_object_hash($result)
819
                    ),
820 2
                    E_USER_WARNING
821 2
                );
822 2
                // @codeCoverageIgnoreStart
823 2
                // PHPUnit turns the warning into an exception, so this never runs
824 2
                return 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...
825 2
                // @codeCoverageIgnoreEnd
826
            }
827 2
828 2
            if ($what === 'type') {
829 2
                return static::getFieldType($field->type);
830 2
            }
831
832 2
            if ($what === 'flags') {
833 2
                return static::getFieldFlags($field->flags);
834 2
            }
835 2
836
            if (isset($field->{$what})) {
837 2
                return $field->{$what};
838 2
            }
839 2
840 2
            return 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...
841 2
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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 mysqlFieldInfo()
Loading history...
842 2
843
        public static function checkValidResult($result, $function)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function checkValidResult()
Loading history...
Coding Style introduced by
function checkValidResult() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
844 2
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
845
            if (!($result instanceof \mysqli_result)) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space(s) after NOT operator; 0 found
Loading history...
846 2
                $type = strtolower(gettype($result));
0 ignored issues
show
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...
847
                $file = "";
0 ignored issues
show
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...
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...
848
                $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
0 ignored issues
show
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...
849 2
                $backtraceIndex = 0;
850
851
                /**
0 ignored issues
show
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...
852 1
                 * Iterate through backtrace until finding a backtrace with an origin
853
                 * Some methods may not leave file and line metadata like call_user_func_array and __call
0 ignored issues
show
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...
854 1
                 */
855 1
                do {
856 1
                    $currentBacktrace = $backtrace[$backtraceIndex];
0 ignored issues
show
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...
857 1
                    $callerHasFileAndLine = isset($currentBacktrace['file'], $currentBacktrace['line']);
0 ignored issues
show
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...
858 1
859 1
                    if ($callerHasFileAndLine && $currentBacktrace['file'] != __FILE__) {
0 ignored issues
show
Coding Style introduced by
Operator != prohibited; use !== instead
Loading history...
860 1
                        $file = $currentBacktrace['file'] . ':' . $currentBacktrace['line'];
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
861 1
                    }
862 1
                } while ($backtraceIndex++ < count($backtrace) && $file == "");
0 ignored issues
show
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...
863 1
864 1
                if ($function !== 'mysql_fetch_object') {
865 1
                    trigger_error(
866 1
                        "$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...
867 1
                        E_USER_WARNING
868 1
                    );
869 1
                }
870 1
871 1
                if ($function === 'mysql_fetch_object') {
872
                    trigger_error(
873 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...
874 1
                        E_USER_WARNING
875
                    );
876
                }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
877 1
                return 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...
878
            }
0 ignored issues
show
Coding Style introduced by
End comment for long condition not found; expected "//end if"
Loading history...
879
880
            return true;
0 ignored issues
show
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...
881
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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 checkValidResult()
Loading history...
882
883
        public static function escapeString($unescapedString)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function escapeString()
Loading history...
884
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
885
            $escapedString = '';
886
            for ($i = 0, $max = strlen($unescapedString); $i < $max; $i++) {
887
                $escapedString .= self::escapeChar($unescapedString[$i]);
888
            }
889
890
            return $escapedString;
891
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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 escapeString()
Loading history...
892
893
        protected static function getFieldFlags($what)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function getFieldFlags()
Loading history...
894
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
895
            // Order of flags taken from http://lxr.php.net/xref/PHP_5_6/ext/mysql/php_mysql.c#2507
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
896
            $flags = array(
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
897
                MYSQLI_NOT_NULL_FLAG => 'not_null',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 7 space(s) but found 1
Loading history...
898
                MYSQLI_PRI_KEY_FLAG => 'primary_key',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 8 space(s) but found 1
Loading history...
899
                MYSQLI_UNIQUE_KEY_FLAG => 'unique_key',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 5 space(s) but found 1
Loading history...
900
                MYSQLI_MULTIPLE_KEY_FLAG => 'multiple_key',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 3 space(s) but found 1
Loading history...
901
                MYSQLI_BLOB_FLAG => 'blob',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 11 space(s) but found 1
Loading history...
902
                MYSQLI_UNSIGNED_FLAG => 'unsigned',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 7 space(s) but found 1
Loading history...
903
                MYSQLI_ZEROFILL_FLAG => 'zerofill',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 7 space(s) but found 1
Loading history...
904
                MYSQLI_BINARY_FLAG => 'binary',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 9 space(s) but found 1
Loading history...
905
                MYSQLI_ENUM_FLAG => 'enum',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 11 space(s) but found 1
Loading history...
906
                MYSQLI_SET_FLAG => 'set',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 12 space(s) but found 1
Loading history...
907
                MYSQLI_AUTO_INCREMENT_FLAG => 'auto_increment',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
908
                MYSQLI_TIMESTAMP_FLAG => 'timestamp',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 6 space(s) but found 1
Loading history...
909
            );
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 21 space(s), but found 12.
Loading history...
910
911
            $fieldFlags = array();
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
912
            foreach ($flags as $flag => $value) {
913
                if ($what & $flag) {
0 ignored issues
show
Coding Style introduced by
Operation must be bracketed
Loading history...
914
                    $fieldFlags[] = $value;
915
                }
916
            }
917
918
            return implode(' ', $fieldFlags);
919
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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 getFieldFlags()
Loading history...
920
921
        protected static function getFieldType($what)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function getFieldType()
Loading history...
922
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
923
            $types = array(
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
924
                MYSQLI_TYPE_STRING => 'string',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 6 space(s) but found 1
Loading history...
925
                MYSQLI_TYPE_VAR_STRING => 'string',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 2 space(s) but found 1
Loading history...
926
                MYSQLI_TYPE_ENUM => 'string',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 8 space(s) but found 1
Loading history...
927
                MYSQLI_TYPE_SET => 'string',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 9 space(s) but found 1
Loading history...
928
929
                MYSQLI_TYPE_LONG => 'int',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 8 space(s) but found 1
Loading history...
930
                MYSQLI_TYPE_TINY => 'int',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 8 space(s) but found 1
Loading history...
931
                MYSQLI_TYPE_SHORT => 'int',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 7 space(s) but found 1
Loading history...
932
                MYSQLI_TYPE_INT24 => 'int',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 7 space(s) but found 1
Loading history...
933
                MYSQLI_TYPE_CHAR => 'int',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 8 space(s) but found 1
Loading history...
934
                MYSQLI_TYPE_LONGLONG => 'int',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 4 space(s) but found 1
Loading history...
935
936
                MYSQLI_TYPE_DECIMAL => 'real',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 5 space(s) but found 1
Loading history...
937
                MYSQLI_TYPE_FLOAT => 'real',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 7 space(s) but found 1
Loading history...
938
                MYSQLI_TYPE_DOUBLE => 'real',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 6 space(s) but found 1
Loading history...
939
                MYSQLI_TYPE_NEWDECIMAL => 'real',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 2 space(s) but found 1
Loading history...
940
941
                MYSQLI_TYPE_TINY_BLOB => 'blob',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 3 space(s) but found 1
Loading history...
942
                MYSQLI_TYPE_MEDIUM_BLOB => 'blob',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
943
                MYSQLI_TYPE_LONG_BLOB => 'blob',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 3 space(s) but found 1
Loading history...
944
                MYSQLI_TYPE_BLOB => 'blob',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 8 space(s) but found 1
Loading history...
945
946
                MYSQLI_TYPE_NEWDATE => 'date',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 5 space(s) but found 1
Loading history...
947
                MYSQLI_TYPE_DATE => 'date',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 8 space(s) but found 1
Loading history...
948
                MYSQLI_TYPE_TIME => 'time',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 8 space(s) but found 1
Loading history...
949
                MYSQLI_TYPE_YEAR => 'year',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 8 space(s) but found 1
Loading history...
950
                MYSQLI_TYPE_DATETIME => 'datetime',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 4 space(s) but found 1
Loading history...
951
                MYSQLI_TYPE_TIMESTAMP => 'timestamp',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 3 space(s) but found 1
Loading history...
952
953
                MYSQLI_TYPE_NULL => 'null',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 8 space(s) but found 1
Loading history...
954
955
                MYSQLI_TYPE_GEOMETRY => 'geometry',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 22 spaces, but found 16.
Loading history...
Coding Style introduced by
Array double arrow not aligned correctly; expected 4 space(s) but found 1
Loading history...
956
            );
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 21 space(s), but found 12.
Loading history...
957
958
            return isset($types[$what]) ? $types[$what] : 'unknown';
0 ignored issues
show
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
959
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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 getFieldType()
Loading history...
960
961
        protected static function escapeChar($char)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function escapeChar()
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...
962
        {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
963
            switch ($char) {
964
                case "\0":
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
965
                    $esc = "\\0";
966
                    break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
967
                case "\n":
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
968
                    $esc = "\\n";
969
                    break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
970
                case "\r":
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
971
                    $esc = "\\r";
972
                    break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
973
                case '\\':
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
974
                case '\'':
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
975
                case '"':
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
976
                    $esc = "\\{$char}";
0 ignored issues
show
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...
977
                    break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
978
                case "\032":
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
979
                    $esc = "\\Z";
0 ignored issues
show
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...
980
                    break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style introduced by
Case breaking statements must be followed by a single blank line
Loading history...
981
                default:
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
982
                    $esc = $char;
983
                    break;
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
984
            }
0 ignored issues
show
Coding Style introduced by
End comment for long condition not found; expected "//end switch"
Loading history...
985
986
            return $esc;
987
        }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines 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...
988
    }
0 ignored issues
show
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...
989
}
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...
990