Passed
Pull Request — master (#158)
by Ashley
02:09
created

Mysqldump::getTableWhere()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 5
c 0
b 0
f 0
nc 3
nop 1
dl 0
loc 9
rs 10
1
<?php
0 ignored issues
show
Coding Style introduced by
There must be no blank lines before the file comment
Loading history...
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
Coding Style introduced by
Filename "Mysqldump.php" doesn't match the expected filename "mysqldump.php"
Loading history...
2
3
/**
4
 * PHP version of mysqldump cli that comes with MySQL
5
 *
6
 * mysql mysqldump pdo php7 php5 database php sql
0 ignored issues
show
Coding Style introduced by
Doc comment long description must start with a capital letter
Loading history...
7
 *
8
 * @category Library
0 ignored issues
show
Coding Style introduced by
The tag in position 1 should be the @package tag
Loading history...
9
 * @package  Ifsnop\Mysqldump
0 ignored issues
show
Coding Style introduced by
The tag in position 2 should be the @subpackage tag
Loading history...
10
 * @author   Diego Torres <[email protected]>
0 ignored issues
show
Coding Style introduced by
Expected "Squiz Pty Ltd <[email protected]>" for author tag
Loading history...
11
 * @license  http://www.gnu.org/copyleft/gpl.html GNU General Public License
0 ignored issues
show
Coding Style introduced by
The tag in position 4 should be the @copyright tag
Loading history...
12
 * @link     https://github.com/ifsnop/mysqldump-php
13
 *
14
 */
0 ignored issues
show
Coding Style Documentation introduced by
Missing @subpackage tag in file comment
Loading history...
Coding Style introduced by
Missing @copyright tag in file comment
Loading history...
Coding Style introduced by
Additional blank lines found at end of doc comment
Loading history...
15
16
namespace Ifsnop\Mysqldump;
17
18
use Exception;
19
use PDO;
20
use PDOException;
21
22
/**
23
 * PHP version of mysqldump cli that comes with MySQL
24
 *
25
 * mysql mysqldump pdo php7 php5 database php sql
0 ignored issues
show
Coding Style introduced by
Doc comment long description must start with a capital letter
Loading history...
26
 *
27
 * @category Library
0 ignored issues
show
Coding Style Documentation introduced by
@category tag is not allowed in class comment
Loading history...
28
 * @package  Ifsnop\Mysqldump
0 ignored issues
show
Coding Style Documentation introduced by
@package tag is not allowed in class comment
Loading history...
29
 * @author   Diego Torres <[email protected]>
0 ignored issues
show
Coding Style Documentation introduced by
@author tag is not allowed in class comment
Loading history...
30
 * @license  http://www.gnu.org/copyleft/gpl.html GNU General Public License
0 ignored issues
show
Coding Style Documentation introduced by
@license tag is not allowed in class comment
Loading history...
31
 * @link     https://github.com/ifsnop/mysqldump-php
0 ignored issues
show
Coding Style Documentation introduced by
@link tag is not allowed in class comment
Loading history...
32
 *
33
 */
0 ignored issues
show
Coding Style introduced by
Additional blank lines found at end of doc comment
Loading history...
34
class Mysqldump
35
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class Mysqldump
Loading history...
36
37
    // Same as mysqldump
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
38
    const MAXLINESIZE = 1000000;
39
40
    // Available compression methods as constants
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
41
    const GZIP = 'Gzip';
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...
42
    const BZIP2 = 'Bzip2';
43
    const NONE = 'None';
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...
44
45
    // Available connection strings
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
46
    const UTF8 = 'utf8';
0 ignored issues
show
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...
47
    const UTF8MB4 = 'utf8mb4';
48
49
    /**
50
     * Database username
51
     * @var string
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
52
     */
53
    public $user;
54
    /**
55
     * Database password
56
     * @var string
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
57
     */
58
    public $pass;
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
59
    /**
60
     * Connection string for PDO
61
     * @var string
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
62
     */
63
    public $dsn;
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
64
    /**
65
     * Destination filename, defaults to stdout
66
     * @var string
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
67
     */
68
    public $fileName = 'php://output';
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
69
70
    // Internal stuff
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
71
    private $tables = array();
0 ignored issues
show
Coding Style introduced by
Private member variable "tables" must contain a leading underscore
Loading history...
Coding Style introduced by
You must use "/**" style comments for a member variable comment
Loading history...
Coding Style introduced by
Private member variable "tables" must be prefixed with an underscore
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...
72
    private $views = array();
0 ignored issues
show
Coding Style introduced by
Private member variable "views" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "views" must be prefixed with an underscore
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space

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

To visualize

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

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

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

will produce no issues.

Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
73
    private $triggers = array();
0 ignored issues
show
Coding Style introduced by
Private member variable "triggers" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "triggers" must be prefixed with an underscore
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
Short array syntax must be used to define arrays
Loading history...
74
    private $procedures = array();
0 ignored issues
show
Coding Style introduced by
Private member variable "procedures" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "procedures" must be prefixed with an underscore
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
75
    private $events = array();
0 ignored issues
show
Coding Style introduced by
Private member variable "events" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "events" must be prefixed with an underscore
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...
76
    private $dbHandler = null;
0 ignored issues
show
Coding Style introduced by
Private member variable "dbHandler" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "dbHandler" must be prefixed with an underscore
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
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
77
    private $dbType = "";
0 ignored issues
show
Coding Style introduced by
Private member variable "dbType" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "dbType" must be prefixed with an underscore
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 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...
78
    private $compressManager;
0 ignored issues
show
Coding Style introduced by
Private member variable "compressManager" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "compressManager" must be prefixed with an underscore
Loading history...
79
    private $typeAdapter;
0 ignored issues
show
Coding Style introduced by
Private member variable "typeAdapter" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "typeAdapter" must be prefixed with an underscore
Loading history...
80
    private $dumpSettings = array();
0 ignored issues
show
Coding Style introduced by
Private member variable "dumpSettings" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "dumpSettings" must be prefixed with an underscore
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
81
    private $pdoSettings = array();
0 ignored issues
show
Coding Style introduced by
Private member variable "pdoSettings" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "pdoSettings" must be prefixed with an underscore
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
Short array syntax must be used to define arrays
Loading history...
82
    private $version;
0 ignored issues
show
Coding Style introduced by
Private member variable "version" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "version" must be prefixed with an underscore
Loading history...
83
    private $tableColumnTypes = array();
0 ignored issues
show
Coding Style introduced by
Private member variable "tableColumnTypes" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "tableColumnTypes" must be prefixed with an underscore
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
84
    private $transformColumnValueCallable;
0 ignored issues
show
Coding Style introduced by
Private member variable "transformColumnValueCallable" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "transformColumnValueCallable" must be prefixed with an underscore
Loading history...
85
    /**
86
     * database name, parsed from dsn
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
87
     * @var string
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
88
     */
89
    private $dbName;
0 ignored issues
show
Coding Style introduced by
Private member variable "dbName" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style introduced by
Private member variable "dbName" must be prefixed with an underscore
Loading history...
90
    /**
91
     * host name, parsed from dsn
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
92
     * @var string
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
93
     */
94
    private $host;
0 ignored issues
show
Coding Style introduced by
Private member variable "host" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style introduced by
Private member variable "host" must be prefixed with an underscore
Loading history...
95
    /**
96
     * dsn string parsed as an array
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
97
     * @var array
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
98
     */
99
    private $dsnArray = array();
0 ignored issues
show
Coding Style introduced by
Private member variable "dsnArray" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style introduced by
Private member variable "dsnArray" must be prefixed with an underscore
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
100
101
    /**
102
     * Keyed on table name, with the value as the conditions
103
     * e.g. - 'users' => 'date_registered > NOW() - INTERVAL 6 MONTH'
104
     *
105
     * @var array
106
     */
107
    private $tableWheres = array();
0 ignored issues
show
Coding Style introduced by
Private member variable "tableWheres" must contain a leading underscore
Loading history...
Coding Style introduced by
Private member variable "tableWheres" must be prefixed with an underscore
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
108
    private $tableLimits = array();
0 ignored issues
show
Coding Style introduced by
Private member variable "tableLimits" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "tableLimits" must be prefixed with an underscore
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
109
110
    /**
111
     * Constructor of Mysqldump. Note that in the case of an SQLite database
112
     * connection, the filename must be in the $db parameter.
113
     *
114
     * @param string $dsn        PDO DSN connection string
0 ignored issues
show
Coding Style introduced by
Expected 10 spaces after parameter name; 8 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
115
     * @param string $user       SQL account username
0 ignored issues
show
Coding Style introduced by
Expected 9 spaces after parameter name; 7 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
116
     * @param string $pass       SQL account password
0 ignored issues
show
Coding Style introduced by
Expected 9 spaces after parameter name; 7 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
117
     * @param array  $dumpSettings SQL database settings
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
118
     * @param array  $pdoSettings  PDO configured attributes
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
119
     */
0 ignored issues
show
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
120
    public function __construct(
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
introduced by
Type hint "array" missing for $dumpSettings
Loading history...
introduced by
Type hint "array" missing for $pdoSettings
Loading history...
121
        $dsn = '',
122
        $user = '',
123
        $pass = '',
124
        $dumpSettings = array(),
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
125
        $pdoSettings = array()
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
126
    ) {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on a new line
Loading history...
127
        $dumpSettingsDefault = array(
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
128
            'include-tables' => array(),
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
129
            'exclude-tables' => array(),
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
130
            'compress' => Mysqldump::NONE,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
131
            'init_commands' => array(),
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
132
            'no-data' => array(),
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
133
            'reset-auto-increment' => false,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
134
            'add-drop-database' => false,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
135
            'add-drop-table' => false,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
136
            'add-drop-trigger' => true,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
137
            'add-locks' => true,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
138
            'complete-insert' => false,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
139
            'databases' => false,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
140
            'default-character-set' => Mysqldump::UTF8,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
141
            'disable-keys' => true,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
142
            'extended-insert' => true,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
143
            'events' => false,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
144
            'hex-blob' => true, /* faster than escaped content */
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
145
            'insert-ignore' => false,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
146
            'net_buffer_length' => self::MAXLINESIZE,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
147
            'no-autocommit' => true,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
148
            'no-create-info' => false,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
149
            'lock-tables' => true,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
150
            'routines' => false,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
151
            'single-transaction' => true,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
152
            'skip-triggers' => false,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
153
            'skip-tz-utc' => false,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
154
            'skip-comments' => false,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
155
            'skip-dump-date' => false,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
156
            'skip-definer' => false,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of false please use FALSE.
Loading history...
157
            'where' => '',
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
158
            /* deprecated */
0 ignored issues
show
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
159
            'disable-foreign-keys-check' => true
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 32 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
160
        );
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 31 space(s), but found 8.
Loading history...
161
162
        $pdoSettingsDefault = array(
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
163
            PDO::ATTR_PERSISTENT => true,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 31 spaces, but found 12.
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of true please use TRUE.
Loading history...
164
            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 31 spaces, but found 12.
Loading history...
165
        );
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 30 space(s), but found 8.
Loading history...
166
167
        $this->user = $user;
168
        $this->pass = $pass;
169
        $this->parseDsn($dsn);
170
171
        // this drops MYSQL dependency, only use the constant if it's defined
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...
172
        if ("mysql" === $this->dbType) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal mysql 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...
introduced by
The condition 'mysql' === $this->dbType is always false.
Loading history...
173
            $pdoSettingsDefault[PDO::MYSQL_ATTR_USE_BUFFERED_QUERY] = 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...
174
        }
175
176
        $this->pdoSettings = self::array_replace_recursive($pdoSettingsDefault, $pdoSettings);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 21 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...
177
        $this->dumpSettings = self::array_replace_recursive($dumpSettingsDefault, $dumpSettings);
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...
178
        $this->dumpSettings['init_commands'][] = "SET NAMES ".$this->dumpSettings['default-character-set'];
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal SET NAMES 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 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...
179
180
        if (false === $this->dumpSettings['skip-tz-utc']) {
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...
181
            $this->dumpSettings['init_commands'][] = "SET TIME_ZONE='+00:00'";
182
        }
183
184
        $diff = array_diff(array_keys($this->dumpSettings), array_keys($dumpSettingsDefault));
185
        if (count($diff) > 0) {
186
            throw new Exception("Unexpected value in dumpSettings: (".implode(",", $diff).")");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Unexpected value in dumpSettings: ( 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 Comprehensibility introduced by
The string literal , does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style 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...
187
        }
188
189
        if (!is_array($this->dumpSettings['include-tables']) ||
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
190
            !is_array($this->dumpSettings['exclude-tables'])) {
0 ignored issues
show
Coding Style introduced by
Each line in a multi-line IF statement must begin with a boolean operator
Loading history...
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
Coding Style introduced by
Closing parenthesis of a multi-line IF statement must be on a new line
Loading history...
191
            throw new Exception("Include-tables and exclude-tables should be arrays");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Include-tables and exclude-tables should be arrays 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...
192
        }
193
194
        // Dump the same views as tables, mimic mysqldump behaviour
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
195
        $this->dumpSettings['include-views'] = $this->dumpSettings['include-tables'];
196
197
        // Create a new compressManager to manage compressed output
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
198
        $this->compressManager = CompressManagerFactory::create($this->dumpSettings['compress']);
199
    }
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 __construct()
Loading history...
200
201
    /**
202
     * Destructor of Mysqldump. Unsets dbHandlers and database objects.
203
     *
204
     */
0 ignored issues
show
Coding Style introduced by
Additional blank lines found at end of doc comment
Loading history...
205
    public function __destruct()
206
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
207
        $this->dbHandler = 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...
208
    }
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 __destruct()
Loading history...
209
210
    /**
211
     * Custom array_replace_recursive to be used if PHP < 5.3
212
     * Replaces elements from passed arrays into the first array recursively
213
     *
214
     * @param array $array1 The array in which elements are replaced
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
215
     * @param array $array2 The array from which elements will be extracted
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
216
     *
217
     * @return array Returns an array, or NULL if an error occurs.
218
     */
219
    public static function array_replace_recursive($array1, $array2)
0 ignored issues
show
Coding Style introduced by
Public method name "Mysqldump::array_replace_recursive" is not in camel caps format
Loading history...
introduced by
Type hint "array" missing for $array1
Loading history...
introduced by
Type hint "array" missing for $array2
Loading history...
Coding Style introduced by
Variable "array1" contains numbers but this is discouraged
Loading history...
Coding Style introduced by
Variable "array2" contains numbers but this is discouraged
Loading history...
220
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
221
        if (function_exists('array_replace_recursive')) {
222
            return array_replace_recursive($array1, $array2);
0 ignored issues
show
Coding Style introduced by
Variable "array1" contains numbers but this is discouraged
Loading history...
Coding Style introduced by
Variable "array2" contains numbers but this is discouraged
Loading history...
223
        }
224
225
        foreach ($array2 as $key => $value) {
0 ignored issues
show
Coding Style introduced by
Variable "array2" contains numbers but this is discouraged
Loading history...
226
            if (is_array($value)) {
227
                $array1[$key] = self::array_replace_recursive($array1[$key], $value);
0 ignored issues
show
Coding Style introduced by
Variable "array1" contains numbers but this is discouraged
Loading history...
228
            } else {
229
                $array1[$key] = $value;
0 ignored issues
show
Coding Style introduced by
Variable "array1" contains numbers but this is discouraged
Loading history...
230
            }
231
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
232
        return $array1;
0 ignored issues
show
Coding Style introduced by
Variable "array1" contains numbers but this is discouraged
Loading history...
233
    }
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 array_replace_recursive()
Loading history...
234
235
    /**
236
     * Keyed by table name, with the value as the conditions:
237
     * e.g. 'users' => 'date_registered > NOW() - INTERVAL 6 MONTH AND deleted=0'
238
     *
239
     * @param array $tableWheres
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
240
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
241
    public function setTableWheres(array $tableWheres)
242
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
243
        $this->tableWheres = $tableWheres;
244
    }
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 setTableWheres()
Loading history...
245
246
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
Parameter $tableName should have a doc-comment as per coding-style.
Loading history...
247
     * @param $tableName
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter name
Loading history...
248
     *
249
     * @return bool|mixed
0 ignored issues
show
Coding Style introduced by
Expected "boolean|mixed" but found "bool|mixed" for function return type
Loading history...
250
     */
251
    public function getTableWhere($tableName)
0 ignored issues
show
introduced by
Type hint "tableName" missing for
Loading history...
252
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
253
        if (!empty($this->tableWheres[$tableName])) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
254
            return $this->tableWheres[$tableName];
255
        } elseif ($this->dumpSettings['where']) {
0 ignored issues
show
Coding Style introduced by
Usage of ELSEIF not allowed; use ELSE IF instead
Loading history...
256
            return $this->dumpSettings['where'];
257
        }
258
259
        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...
260
    }
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 getTableWhere()
Loading history...
261
262
    /**
263
     * Keyed by table name, with the value as the numeric limit:
264
     * e.g. 'users' => 3000
265
     *
266
     * @param array $tableLimits
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
267
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
268
    public function setTableLimits(array $tableLimits)
269
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
270
        $this->tableLimits = $tableLimits;
271
    }
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 setTableLimits()
Loading history...
272
273
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $tableName should have a doc-comment as per coding-style.
Loading history...
274
     * Returns the LIMIT for the table.  Must be numeric to be returned.
275
     * @param $tableName
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
Coding Style Documentation introduced by
Missing parameter name
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
276
     * @return bool
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
Coding Style introduced by
Expected "boolean" but found "bool" for function return type
Loading history...
277
     */
278
    public function getTableLimit($tableName)
0 ignored issues
show
introduced by
Type hint "tableName" missing for
Loading history...
279
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
280
        if (empty($this->tableLimits[$tableName])) {
281
            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...
282
        }
283
284
        $limit = $this->tableLimits[$tableName];
285
        if (!is_numeric($limit)) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
286
            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...
287
        }
288
289
        return $limit;
290
    }
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 getTableLimit()
Loading history...
291
292
    /**
293
     * Parse DSN string and extract dbname value
294
     * Several examples of a DSN string
295
     *   mysql:host=localhost;dbname=testdb
296
     *   mysql:host=localhost;port=3307;dbname=testdb
297
     *   mysql:unix_socket=/tmp/mysql.sock;dbname=testdb
298
     *
299
     * @param string $dsn dsn string to parse
0 ignored issues
show
introduced by
Parameter comment must start with a capital letter
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
300
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
301
    private function parseDsn($dsn)
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::parseDsn" must be prefixed with an underscore
Loading history...
302
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
303
        if (empty($dsn) || (false === ($pos = strpos($dsn, ":")))) {
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
Assignments must be the first block of code on a line
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...
304
            throw new Exception("Empty DSN string");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Empty DSN string 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...
305
        }
306
307
        $this->dsn = $dsn;
0 ignored issues
show
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...
308
        $this->dbType = strtolower(substr($dsn, 0, $pos)); // always returns a string
0 ignored issues
show
Coding Style introduced by
Comments may not appear after statements
Loading history...
Coding Style Documentation introduced by
Inline comments must start with a capital letter
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
309
310
        if (empty($this->dbType)) {
311
            throw new Exception("Missing database type from DSN string");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Missing database type from DSN string 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...
312
        }
313
314
        $dsn = substr($dsn, $pos + 1);
0 ignored issues
show
Coding Style introduced by
Arithmetic operation must be bracketed
Loading history...
315
316
        foreach (explode(";", $dsn) as $kvp) {
0 ignored issues
show
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...
317
            $kvpArr = explode("=", $kvp);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 33 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...
318
            $this->dsnArray[strtolower($kvpArr[0])] = $kvpArr[1];
319
        }
320
321
        if (empty($this->dsnArray['host']) &&
322
            empty($this->dsnArray['unix_socket'])) {
0 ignored issues
show
Coding Style introduced by
Each line in a multi-line IF statement must begin with a boolean operator
Loading history...
Coding Style introduced by
Closing parenthesis of a multi-line IF statement must be on a new line
Loading history...
323
            throw new Exception("Missing host from DSN string");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Missing host from DSN string 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...
324
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
325
        $this->host = (!empty($this->dsnArray['host'])) ?
0 ignored issues
show
Coding Style introduced by
The value of a boolean operation must not be assigned to a variable
Loading history...
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
Coding Style introduced by
Expected 1 space after "?"; newline found
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
Coding Style introduced by
Inline shorthand IF statement must be declared on a single line
Loading history...
326
            $this->dsnArray['host'] : $this->dsnArray['unix_socket'];
327
328
        if (empty($this->dsnArray['dbname'])) {
329
            throw new Exception("Missing database name from DSN string");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Missing database name from DSN string 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...
330
        }
331
332
        $this->dbName = $this->dsnArray['dbname'];
333
334
        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...
335
    }
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 parseDsn()
Loading history...
336
337
    /**
338
     * Connect with PDO
339
     *
340
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
341
     */
0 ignored issues
show
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
342
    private function connect()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::connect" must be prefixed with an underscore
Loading history...
343
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
344
        // Connecting with PDO
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
345
        try {
346
            switch ($this->dbType) {
347
                case 'sqlite':
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
348
                    $this->dbHandler = @new PDO("sqlite:".$this->dbName, null, null, $this->pdoSettings);
0 ignored issues
show
Coding Style introduced by
Silencing errors is discouraged
Loading history...
Coding Style Comprehensibility introduced by
The string literal sqlite: 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
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
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...
349
                    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...
350
                case 'mysql':
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
351
                case 'pgsql':
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
352
                case 'dblib':
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
353
                    $this->dbHandler = @new PDO(
0 ignored issues
show
Coding Style introduced by
Silencing errors is discouraged
Loading history...
354
                        $this->dsn,
355
                        $this->user,
356
                        $this->pass,
357
                        $this->pdoSettings
358
                    );
359
                    // Execute init commands once connected
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
360
                    foreach ($this->dumpSettings['init_commands'] as $stmt) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 20
Loading history...
361
                        $this->dbHandler->exec($stmt);
362
                    }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 20
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
363
                    // Store server version
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
364
                    $this->version = $this->dbHandler->getAttribute(PDO::ATTR_SERVER_VERSION);
365
                    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...
366
                default:
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
367
                    throw new Exception("Unsupported database type (".$this->dbType.")");
0 ignored issues
show
Coding Style introduced by
Case breaking statement must be indented 4 spaces from SWITCH keyword
Loading history...
Coding Style Comprehensibility introduced by
The string literal Unsupported database type ( 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 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...
Bug introduced by
Are you sure $this->dbType of type mixed can be used in concatenation? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

367
                    throw new Exception("Unsupported database type ("./** @scrutinizer ignore-type */ $this->dbType.")");
Loading history...
368
            }
0 ignored issues
show
Coding Style introduced by
End comment for long condition not found; expected "//end switch"
Loading history...
369
        } catch (PDOException $e) {
370
            throw new Exception(
371
                "Connection to ".$this->dbType." failed with message: ".
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Connection to 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 Comprehensibility introduced by
The string literal failed with message: 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
Concat operator must not be surrounded by spaces
Loading history...
372
                $e->getMessage()
373
            );
374
        }
0 ignored issues
show
Coding Style introduced by
End comment for long condition not found; expected "//end try"
Loading history...
375
376
        if (is_null($this->dbHandler)) {
377
            throw new Exception("Connection to ".$this->dbType."failed");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Connection to 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 Comprehensibility introduced by
The string literal failed 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...
378
        }
379
380
        $this->dbHandler->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_NATURAL);
381
        $this->typeAdapter = TypeAdapterFactory::create($this->dbType, $this->dbHandler, $this->dumpSettings);
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 110 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...
382
    }
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 connect()
Loading history...
383
384
    /**
385
     * Main call
386
     *
387
     * @param string $filename  Name of file to write sql dump to
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter name; 2 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
388
     * @return null
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
introduced by
Function return type is not void, but function has no return statement
Loading history...
389
     */
0 ignored issues
show
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
390
    public function start($filename = '')
391
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
392
        // Output file can be redefined here
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
393
        if (!empty($filename)) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
394
            $this->fileName = $filename;
395
        }
396
397
        // Connect to database
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
398
        $this->connect();
399
400
        // Create output file
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
401
        $this->compressManager->open($this->fileName);
402
403
        // Write some basic info to output file
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
404
        $this->compressManager->write($this->getDumpFileHeader());
405
406
        // Store server settings and use sanner defaults to dump
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
407
        $this->compressManager->write(
408
            $this->typeAdapter->backup_parameters()
409
        );
410
411
        if ($this->dumpSettings['databases']) {
412
            $this->compressManager->write(
413
                $this->typeAdapter->getDatabaseHeader($this->dbName)
414
            );
415
            if ($this->dumpSettings['add-drop-database']) {
416
                $this->compressManager->write(
417
                    $this->typeAdapter->add_drop_database($this->dbName)
418
                );
419
            }
420
        }
421
422
        // Get table, view, trigger, procedures and events
423
        // structures from database
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
424
        $this->getDatabaseStructureTables();
425
        $this->getDatabaseStructureViews();
426
        $this->getDatabaseStructureTriggers();
427
        $this->getDatabaseStructureProcedures();
428
        $this->getDatabaseStructureEvents();
429
430
        if ($this->dumpSettings['databases']) {
431
            $this->compressManager->write(
432
                $this->typeAdapter->databases($this->dbName)
433
            );
434
        }
435
436
        // If there still are some tables/views in include-tables array,
437
        // that means that some tables or views weren't found.
438
        // Give proper error and exit.
439
        // This check will be removed once include-tables supports regexps
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
440
        if (0 < count($this->dumpSettings['include-tables'])) {
441
            $name = implode(",", $this->dumpSettings['include-tables']);
0 ignored issues
show
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...
442
            throw new Exception("Table (".$name.") not found in database");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Table ( 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 Comprehensibility introduced by
The string literal ) not found in database 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...
443
        }
444
445
        $this->exportTables();
446
        $this->exportTriggers();
447
        $this->exportViews();
448
        $this->exportProcedures();
449
        $this->exportEvents();
450
451
        // Restore saved parameters
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
452
        $this->compressManager->write(
453
            $this->typeAdapter->restore_parameters()
454
        );
455
        // Write some stats to output file
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
456
        $this->compressManager->write($this->getDumpFileFooter());
457
        // Close output file
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
458
        $this->compressManager->close();
459
    }
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 start()
Loading history...
460
461
    /**
462
     * Returns header for dump file
463
     *
464
     * @return string
465
     */
466
    private function getDumpFileHeader()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDumpFileHeader" must be prefixed with an underscore
Loading history...
467
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
468
        $header = '';
469
        if (!$this->dumpSettings['skip-comments']) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
470
            // Some info about software, source and time
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
471
            $header = "-- mysqldump-php https://github.com/ifsnop/mysqldump-php".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal -- mysqldump-php https:/...om/ifsnop/mysqldump-php 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
Concat operator must not be surrounded by spaces
Loading history...
472
                    "--".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal -- does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
473
                    "-- Host: {$this->host}\tDatabase: {$this->dbName}".PHP_EOL.
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $this 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
Concat operator must not be surrounded by spaces
Loading history...
474
                    "-- ------------------------------------------------------".PHP_EOL;
0 ignored issues
show
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...
475
476
            if (!empty($this->version)) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
477
                $header .= "-- Server version \t".$this->version.PHP_EOL;
478
            }
479
480
            if (!$this->dumpSettings['skip-dump-date']) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
481
                $header .= "-- Date: ".date('r').PHP_EOL.PHP_EOL;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal -- Date: 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...
482
            }
483
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
484
        return $header;
485
    }
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 getDumpFileHeader()
Loading history...
486
487
    /**
488
     * Returns footer for dump file
489
     *
490
     * @return string
491
     */
492
    private function getDumpFileFooter()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDumpFileFooter" must be prefixed with an underscore
Loading history...
493
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
494
        $footer = '';
495
        if (!$this->dumpSettings['skip-comments']) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
496
            $footer .= '-- Dump completed';
497
            if (!$this->dumpSettings['skip-dump-date']) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
498
                $footer .= ' on: '.date('r');
499
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
500
            $footer .= PHP_EOL;
501
        }
502
503
        return $footer;
504
    }
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 getDumpFileFooter()
Loading history...
505
506
    /**
507
     * Reads table names from database.
508
     * Fills $this->tables array so they will be dumped later.
509
     *
510
     * @return null
511
     */
512
    private function getDatabaseStructureTables()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDatabaseStructureTables" must be prefixed with an underscore
Loading history...
513
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
514
        // Listing all tables from database
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
515
        if (empty($this->dumpSettings['include-tables'])) {
516
            // include all tables for now, blacklisting happens later
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...
517
            foreach ($this->dbHandler->query($this->typeAdapter->show_tables($this->dbName)) as $row) {
0 ignored issues
show
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...
518
                array_push($this->tables, current($row));
519
            }
520
        } else {
521
            // include only the tables mentioned in include-tables
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...
522
            foreach ($this->dbHandler->query($this->typeAdapter->show_tables($this->dbName)) as $row) {
0 ignored issues
show
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...
523
                if (in_array(current($row), $this->dumpSettings['include-tables'], 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...
524
                    array_push($this->tables, current($row));
525
                    $elem = array_search(
526
                        current($row),
527
                        $this->dumpSettings['include-tables']
528
                    );
529
                    unset($this->dumpSettings['include-tables'][$elem]);
530
                }
531
            }
532
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
533
        return;
0 ignored issues
show
Coding Style introduced by
Empty return statement not required here
Loading history...
introduced by
Function return type is not void, but function is returning void here
Loading history...
534
    }
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 getDatabaseStructureTables()
Loading history...
535
536
    /**
537
     * Reads view names from database.
538
     * Fills $this->tables array so they will be dumped later.
539
     *
540
     * @return null
541
     */
542
    private function getDatabaseStructureViews()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDatabaseStructureViews" must be prefixed with an underscore
Loading history...
543
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
544
        // Listing all views from database
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
545
        if (empty($this->dumpSettings['include-views'])) {
546
            // include all views for now, blacklisting happens later
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...
547
            foreach ($this->dbHandler->query($this->typeAdapter->show_views($this->dbName)) as $row) {
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 102 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...
548
                array_push($this->views, current($row));
549
            }
550
        } else {
551
            // include only the tables mentioned in include-tables
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...
552
            foreach ($this->dbHandler->query($this->typeAdapter->show_views($this->dbName)) as $row) {
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 102 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...
553
                if (in_array(current($row), $this->dumpSettings['include-views'], 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...
554
                    array_push($this->views, current($row));
555
                    $elem = array_search(
556
                        current($row),
557
                        $this->dumpSettings['include-views']
558
                    );
559
                    unset($this->dumpSettings['include-views'][$elem]);
560
                }
561
            }
562
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
563
        return;
0 ignored issues
show
Coding Style introduced by
Empty return statement not required here
Loading history...
introduced by
Function return type is not void, but function is returning void here
Loading history...
564
    }
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 getDatabaseStructureViews()
Loading history...
565
566
    /**
567
     * Reads trigger names from database.
568
     * Fills $this->tables array so they will be dumped later.
569
     *
570
     * @return null
571
     */
572
    private function getDatabaseStructureTriggers()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDatabaseStructureTriggers" must be prefixed with an underscore
Loading history...
573
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
574
        // Listing all triggers from database
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
575
        if (false === $this->dumpSettings['skip-triggers']) {
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...
576
            foreach ($this->dbHandler->query($this->typeAdapter->show_triggers($this->dbName)) as $row) {
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...
577
                array_push($this->triggers, $row['Trigger']);
578
            }
579
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
580
        return;
0 ignored issues
show
Coding Style introduced by
Empty return statement not required here
Loading history...
introduced by
Function return type is not void, but function is returning void here
Loading history...
581
    }
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 getDatabaseStructureTriggers()
Loading history...
582
583
    /**
584
     * Reads procedure names from database.
585
     * Fills $this->tables array so they will be dumped later.
586
     *
587
     * @return null
588
     */
589
    private function getDatabaseStructureProcedures()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDatabaseStructureProcedures" must be prefixed with an underscore
Loading history...
590
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
591
        // Listing all procedures from database
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
592
        if ($this->dumpSettings['routines']) {
593
            foreach ($this->dbHandler->query($this->typeAdapter->show_procedures($this->dbName)) as $row) {
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...
594
                array_push($this->procedures, $row['procedure_name']);
595
            }
596
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
597
        return;
0 ignored issues
show
Coding Style introduced by
Empty return statement not required here
Loading history...
introduced by
Function return type is not void, but function is returning void here
Loading history...
598
    }
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 getDatabaseStructureProcedures()
Loading history...
599
600
    /**
601
     * Reads event names from database.
602
     * Fills $this->tables array so they will be dumped later.
603
     *
604
     * @return null
605
     */
606
    private function getDatabaseStructureEvents()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDatabaseStructureEvents" must be prefixed with an underscore
Loading history...
607
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
608
        // Listing all events from database
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
609
        if ($this->dumpSettings['events']) {
610
            foreach ($this->dbHandler->query($this->typeAdapter->show_events($this->dbName)) as $row) {
0 ignored issues
show
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...
611
                array_push($this->events, $row['event_name']);
612
            }
613
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
614
        return;
0 ignored issues
show
Coding Style introduced by
Empty return statement not required here
Loading history...
introduced by
Function return type is not void, but function is returning void here
Loading history...
615
    }
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 getDatabaseStructureEvents()
Loading history...
616
617
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $table should have a doc-comment as per coding-style.
Loading history...
Coding Style introduced by
Parameter $arr should have a doc-comment as per coding-style.
Loading history...
618
     * Compare if $table name matches with a definition inside $arr
619
     * @param $table string
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
Coding Style Documentation introduced by
Missing parameter name
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
620
     * @param $arr array with strings or patterns
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter name
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
621
     * @return bool
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
Coding Style introduced by
Expected "boolean" but found "bool" for function return type
Loading history...
622
     */
623
    private function matches($table, $arr)
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::matches" must be prefixed with an underscore
Loading history...
introduced by
Type hint "table string" missing for
Loading history...
introduced by
Type hint "array" missing for
Loading history...
624
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
625
        $match = 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...
626
627
        foreach ($arr as $pattern) {
628
            if ('/' != $pattern[0]) {
0 ignored issues
show
Coding Style introduced by
Operator != prohibited; use !== instead
Loading history...
629
                continue;
630
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
631
            if (1 == preg_match($pattern, $table)) {
0 ignored issues
show
Coding Style introduced by
Operator == prohibited; use === instead
Loading history...
632
                $match = 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...
633
            }
634
        }
635
636
        return in_array($table, $arr) || $match;
0 ignored issues
show
Coding Style introduced by
Boolean operators are not allowed outside of control structure conditions
Loading history...
637
    }
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 matches()
Loading history...
638
639
    /**
640
     * Exports all the tables selected from database
641
     *
642
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
643
     */
644
    private function exportTables()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::exportTables" must be prefixed with an underscore
Loading history...
645
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
646
        // Exporting tables one by one
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
647
        foreach ($this->tables as $table) {
648
            if ($this->matches($table, $this->dumpSettings['exclude-tables'])) {
649
                continue;
650
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
651
            $this->getTableStructure($table);
652
            if (false === $this->dumpSettings['no-data']) { // don't break compatibility with old trigger
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
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...
Coding Style introduced by
Comments may not appear after statements
Loading history...
Coding Style Documentation introduced by
Inline comments must start with a capital letter
Loading history...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
653
                $this->listValues($table);
654
            } elseif (true === $this->dumpSettings['no-data']
0 ignored issues
show
Coding Style introduced by
Usage of ELSEIF not allowed; use ELSE IF instead
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...
655
                 || $this->matches($table, $this->dumpSettings['no-data'])) {
0 ignored issues
show
Coding Style introduced by
Multi-line IF statement not indented correctly; expected 16 spaces but found 17
Loading history...
Coding Style introduced by
Closing parenthesis of a multi-line IF statement must be on a new line
Loading history...
656
                continue;
657
            } else {
658
                $this->listValues($table);
659
            }
660
        }
661
    }
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 exportTables()
Loading history...
662
663
    /**
664
     * Exports all the views found in database
665
     *
666
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
667
     */
668
    private function exportViews()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::exportViews" must be prefixed with an underscore
Loading history...
669
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
670
        if (false === $this->dumpSettings['no-create-info']) {
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...
671
            // Exporting views one by one
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
672
            foreach ($this->views as $view) {
673
                if ($this->matches($view, $this->dumpSettings['exclude-tables'])) {
674
                    continue;
675
                }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
676
                $this->tableColumnTypes[$view] = $this->getTableColumnTypes($view);
677
                $this->getViewStructureTable($view);
678
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
679
            foreach ($this->views as $view) {
680
                if ($this->matches($view, $this->dumpSettings['exclude-tables'])) {
681
                    continue;
682
                }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
683
                $this->getViewStructureView($view);
684
            }
685
        }
686
    }
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 exportViews()
Loading history...
687
688
    /**
689
     * Exports all the triggers found in database
690
     *
691
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
692
     */
693
    private function exportTriggers()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::exportTriggers" must be prefixed with an underscore
Loading history...
694
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
695
        // Exporting triggers one by one
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
696
        foreach ($this->triggers as $trigger) {
697
            $this->getTriggerStructure($trigger);
698
        }
699
    }
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 exportTriggers()
Loading history...
700
701
    /**
702
     * Exports all the procedures found in database
703
     *
704
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
705
     */
706
    private function exportProcedures()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::exportProcedures" must be prefixed with an underscore
Loading history...
707
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
708
        // Exporting triggers one by one
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
709
        foreach ($this->procedures as $procedure) {
710
            $this->getProcedureStructure($procedure);
711
        }
712
    }
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 exportProcedures()
Loading history...
713
714
    /**
715
     * Exports all the events found in database
716
     *
717
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
718
     */
719
    private function exportEvents()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::exportEvents" must be prefixed with an underscore
Loading history...
720
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
721
        // Exporting triggers one by one
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
722
        foreach ($this->events as $event) {
723
            $this->getEventStructure($event);
724
        }
725
    }
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 exportEvents()
Loading history...
726
727
    /**
728
     * Table structure extractor
729
     *
730
     * @todo move specific mysql code to typeAdapter
0 ignored issues
show
Coding Style introduced by
Comment refers to a TODO task

This check looks TODO comments that have been left in the code.

``TODO``s show that something is left unfinished and should be attended to.

Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 3 spaces but found 1
Loading history...
731
     * @param string $tableName  Name of table to export
0 ignored issues
show
Coding Style introduced by
Parameter tags must be grouped together in a doc comment
Loading history...
Coding Style introduced by
Expected 1 spaces after parameter name; 2 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
732
     * @return null
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
733
     */
734
    private function getTableStructure($tableName)
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getTableStructure" must be prefixed with an underscore
Loading history...
735
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
736
        if (!$this->dumpSettings['no-create-info']) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
737
            $ret = '';
738
            if (!$this->dumpSettings['skip-comments']) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
739
                $ret = "--".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal -- does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
740
                    "-- Table structure for table `$tableName`".PHP_EOL.
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $tableName 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
Concat operator must not be surrounded by spaces
Loading history...
741
                    "--".PHP_EOL.PHP_EOL;
0 ignored issues
show
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...
742
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
743
            $stmt = $this->typeAdapter->show_create_table($tableName);
744
            foreach ($this->dbHandler->query($stmt) as $r) {
745
                $this->compressManager->write($ret);
746
                if ($this->dumpSettings['add-drop-table']) {
747
                    $this->compressManager->write(
748
                        $this->typeAdapter->drop_table($tableName)
749
                    );
750
                }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
751
                $this->compressManager->write(
752
                    $this->typeAdapter->create_table($r)
753
                );
754
                break;
755
            }
756
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
Coding Style introduced by
End comment for long condition not found; expected "//end if"
Loading history...
757
        $this->tableColumnTypes[$tableName] = $this->getTableColumnTypes($tableName);
758
        return;
0 ignored issues
show
Coding Style introduced by
Empty return statement not required here
Loading history...
introduced by
Function return type is not void, but function is returning void here
Loading history...
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 getTableStructure()
Loading history...
760
761
    /**
762
     * Store column types to create data dumps and for Stand-In tables
763
     *
764
     * @param string $tableName  Name of table to export
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter name; 2 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
765
     * @return array type column types detailed
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
766
     */
0 ignored issues
show
Coding Style introduced by
There must be no blank lines after the function comment
Loading history...
767
768
    private function getTableColumnTypes($tableName)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
Coding Style introduced by
Private method name "Mysqldump::getTableColumnTypes" must be prefixed with an underscore
Loading history...
769
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
770
        $columnTypes = array();
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
771
        $columns = $this->dbHandler->query(
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...
772
            $this->typeAdapter->show_columns($tableName)
773
        );
774
        $columns->setFetchMode(PDO::FETCH_ASSOC);
775
776
        foreach ($columns as $key => $col) {
777
            $types = $this->typeAdapter->parseColumnType($col);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 22 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...
778
            $columnTypes[$col['Field']] = array(
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
779
                'is_numeric'=> $types['is_numeric'],
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 43 spaces, but found 16.
Loading history...
Coding Style introduced by
Expected 1 space before "=>"; 0 found
Loading history...
780
                'is_blob' => $types['is_blob'],
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 43 spaces, but found 16.
Loading history...
781
                'type' => $types['type'],
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 43 spaces, but found 16.
Loading history...
782
                'type_sql' => $col['Type'],
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 43 spaces, but found 16.
Loading history...
783
                'is_virtual' => $types['is_virtual']
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 43 spaces, but found 16.
Loading history...
784
            );
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 42 space(s), but found 12.
Loading history...
785
        }
786
787
        return $columnTypes;
788
    }
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 getTableColumnTypes()
Loading history...
789
790
    /**
791
     * View structure extractor, create table (avoids cyclic references)
792
     *
793
     * @todo move mysql specific code to typeAdapter
0 ignored issues
show
Coding Style introduced by
Comment refers to a TODO task

This check looks TODO comments that have been left in the code.

``TODO``s show that something is left unfinished and should be attended to.

Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 3 spaces but found 1
Loading history...
794
     * @param string $viewName  Name of view to export
0 ignored issues
show
Coding Style introduced by
Parameter tags must be grouped together in a doc comment
Loading history...
Coding Style introduced by
Expected 1 spaces after parameter name; 2 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
795
     * @return null
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
introduced by
Function return type is not void, but function has no return statement
Loading history...
796
     */
797
    private function getViewStructureTable($viewName)
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getViewStructureTable" must be prefixed with an underscore
Loading history...
798
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
799
        if (!$this->dumpSettings['skip-comments']) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
800
            $ret = "--".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal -- does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
801
                "-- Stand-In structure for view `${viewName}`".PHP_EOL.
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
802
                "--".PHP_EOL.PHP_EOL;
0 ignored issues
show
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...
803
            $this->compressManager->write($ret);
804
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
805
        $stmt = $this->typeAdapter->show_create_view($viewName);
806
807
        // create views as tables, to resolve dependencies
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...
808
        foreach ($this->dbHandler->query($stmt) as $r) {
809
            if ($this->dumpSettings['add-drop-table']) {
810
                $this->compressManager->write(
811
                    $this->typeAdapter->drop_view($viewName)
812
                );
813
            }
814
815
            $this->compressManager->write(
816
                $this->createStandInTable($viewName)
817
            );
818
            break;
819
        }
820
    }
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 getViewStructureTable()
Loading history...
821
822
    /**
823
     * Write a create table statement for the table Stand-In, show create
824
     * table would return a create algorithm when used on a view
825
     *
826
     * @param string $viewName  Name of view to export
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter name; 2 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
827
     * @return string create statement
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
828
     */
829
    public function createStandInTable($viewName)
830
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
831
        $ret = array();
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
832
        foreach ($this->tableColumnTypes[$viewName] as $k => $v) {
833
            $ret[] = "`${k}` ${v['type_sql']}";
834
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
835
        $ret = implode(PHP_EOL.",", $ret);
0 ignored issues
show
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...
836
837
        $ret = "CREATE TABLE IF NOT EXISTS `$viewName` (".
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $viewName 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
Concat operator must not be surrounded by spaces
Loading history...
838
            PHP_EOL.$ret.PHP_EOL.");".PHP_EOL;
0 ignored issues
show
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...
839
840
        return $ret;
841
    }
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 createStandInTable()
Loading history...
842
843
    /**
844
     * View structure extractor, create view
845
     *
846
     * @todo move mysql specific code to typeAdapter
0 ignored issues
show
Coding Style introduced by
Comment refers to a TODO task

This check looks TODO comments that have been left in the code.

``TODO``s show that something is left unfinished and should be attended to.

Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 3 spaces but found 1
Loading history...
847
     * @param string $viewName  Name of view to export
0 ignored issues
show
Coding Style introduced by
Parameter tags must be grouped together in a doc comment
Loading history...
Coding Style introduced by
Expected 1 spaces after parameter name; 2 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
848
     * @return null
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
introduced by
Function return type is not void, but function has no return statement
Loading history...
849
     */
850
    private function getViewStructureView($viewName)
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getViewStructureView" must be prefixed with an underscore
Loading history...
851
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
852
        if (!$this->dumpSettings['skip-comments']) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
853
            $ret = "--".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal -- does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
854
                "-- View structure for view `${viewName}`".PHP_EOL.
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
855
                "--".PHP_EOL.PHP_EOL;
0 ignored issues
show
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...
856
            $this->compressManager->write($ret);
857
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
858
        $stmt = $this->typeAdapter->show_create_view($viewName);
859
860
        // create views, to resolve dependencies
0 ignored issues
show
Coding Style Documentation introduced by
Inline comments must start with a capital letter
Loading history...
861
        // replacing tables with views
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
862
        foreach ($this->dbHandler->query($stmt) as $r) {
863
            // because we must replace table with view, we should delete it
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...
864
            $this->compressManager->write(
865
                $this->typeAdapter->drop_view($viewName)
866
            );
867
            $this->compressManager->write(
868
                $this->typeAdapter->create_view($r)
869
            );
870
            break;
871
        }
872
    }
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 getViewStructureView()
Loading history...
873
874
    /**
875
     * Trigger structure extractor
876
     *
877
     * @param string $triggerName  Name of trigger to export
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter name; 2 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
878
     * @return null
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
879
     */
880
    private function getTriggerStructure($triggerName)
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getTriggerStructure" must be prefixed with an underscore
Loading history...
881
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
882
        $stmt = $this->typeAdapter->show_create_trigger($triggerName);
883
        foreach ($this->dbHandler->query($stmt) as $r) {
884
            if ($this->dumpSettings['add-drop-trigger']) {
885
                $this->compressManager->write(
886
                    $this->typeAdapter->add_drop_trigger($triggerName)
887
                );
888
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
889
            $this->compressManager->write(
890
                $this->typeAdapter->create_trigger($r)
891
            );
892
            return;
0 ignored issues
show
introduced by
Function return type is not void, but function is returning void here
Loading history...
893
        }
894
    }
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 getTriggerStructure()
Loading history...
895
896
    /**
897
     * Procedure structure extractor
898
     *
899
     * @param string $procedureName  Name of procedure to export
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter name; 2 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
900
     * @return null
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
901
     */
902
    private function getProcedureStructure($procedureName)
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getProcedureStructure" must be prefixed with an underscore
Loading history...
903
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
904
        if (!$this->dumpSettings['skip-comments']) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
905
            $ret = "--".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal -- does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
906
                "-- Dumping routines for database '".$this->dbName."'".PHP_EOL.
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
907
                "--".PHP_EOL.PHP_EOL;
0 ignored issues
show
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...
908
            $this->compressManager->write($ret);
909
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
910
        $stmt = $this->typeAdapter->show_create_procedure($procedureName);
911
        foreach ($this->dbHandler->query($stmt) as $r) {
912
            $this->compressManager->write(
913
                $this->typeAdapter->create_procedure($r)
914
            );
915
            return;
0 ignored issues
show
introduced by
Function return type is not void, but function is returning void here
Loading history...
916
        }
917
    }
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 getProcedureStructure()
Loading history...
918
919
    /**
920
     * Event structure extractor
921
     *
922
     * @param string $eventName  Name of event to export
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter name; 2 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
923
     * @return null
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
924
     */
925
    private function getEventStructure($eventName)
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getEventStructure" must be prefixed with an underscore
Loading history...
926
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
927
        if (!$this->dumpSettings['skip-comments']) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
928
            $ret = "--".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal -- does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
929
                "-- Dumping events for database '".$this->dbName."'".PHP_EOL.
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
930
                "--".PHP_EOL.PHP_EOL;
0 ignored issues
show
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...
931
            $this->compressManager->write($ret);
932
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
933
        $stmt = $this->typeAdapter->show_create_event($eventName);
934
        foreach ($this->dbHandler->query($stmt) as $r) {
935
            $this->compressManager->write(
936
                $this->typeAdapter->create_event($r)
937
            );
938
            return;
0 ignored issues
show
introduced by
Function return type is not void, but function is returning void here
Loading history...
939
        }
940
    }
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 getEventStructure()
Loading history...
941
942
    /**
943
     * Prepare values for output
944
     *
945
     * @param string $tableName Name of table which contains rows
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
946
     * @param array $row Associative array of column names and values to be
0 ignored issues
show
Coding Style introduced by
Expected 2 spaces after parameter type; 1 found
Loading history...
Coding Style introduced by
Expected 7 spaces after parameter name; 1 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
947
     *   quoted
0 ignored issues
show
Coding Style introduced by
Parameter comment not aligned correctly; expected 19 spaces but found 3
Loading history...
948
     *
949
     * @return array
950
     */
951
    private function prepareColumnValues($tableName, $row)
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::prepareColumnValues" must be prefixed with an underscore
Loading history...
introduced by
Type hint "array" missing for $row
Loading history...
952
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
953
        $ret = array();
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
Short array syntax must be used to define arrays
Loading history...
954
        $columnTypes = $this->tableColumnTypes[$tableName];
955
        foreach ($row as $colName => $colValue) {
956
            $colValue = $this->hookTransformColumnValue($tableName, $colName, $colValue, $row);
957
            $ret[] = $this->escape($colValue, $columnTypes[$colName]);
0 ignored issues
show
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...
958
        }
959
960
        return $ret;
961
    }
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 prepareColumnValues()
Loading history...
962
963
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $colValue should have a doc-comment as per coding-style.
Loading history...
Coding Style introduced by
Parameter $colType should have a doc-comment as per coding-style.
Loading history...
964
     * Escape values with quotes when needed
965
     *
966
     * @param string $tableName Name of table which contains rows
0 ignored issues
show
Coding Style introduced by
Doc comment for parameter $tableName does not match actual variable name $colValue
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
967
     * @param array $row Associative array of column names and values to be quoted
0 ignored issues
show
Coding Style introduced by
Expected 2 spaces after parameter type; 1 found
Loading history...
Coding Style introduced by
Doc comment for parameter $row does not match actual variable name $colType
Loading history...
Coding Style introduced by
Expected 7 spaces after parameter name; 1 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
968
     *
969
     * @return string
970
     */
971
    private function escape($colValue, $colType)
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::escape" must be prefixed with an underscore
Loading history...
introduced by
Type hint "array" missing for $row
Loading history...
972
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
973
        if (is_null($colValue)) {
974
            return "NULL";
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal NULL 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...
975
        } elseif ($this->dumpSettings['hex-blob'] && $colType['is_blob']) {
0 ignored issues
show
Coding Style introduced by
Usage of ELSEIF not allowed; use ELSE IF instead
Loading history...
976
            if ($colType['type'] == 'bit' || !empty($colValue)) {
0 ignored issues
show
Coding Style introduced by
Operator == prohibited; use === instead
Loading history...
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
977
                return "0x${colValue}";
978
            } else {
979
                return "''";
980
            }
981
        } elseif ($colType['is_numeric']) {
0 ignored issues
show
Coding Style introduced by
Usage of ELSEIF not allowed; use ELSE IF instead
Loading history...
982
            return $colValue;
983
        }
984
985
        return $this->dbHandler->quote($colValue);
986
    }
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 escape()
Loading history...
987
988
    /**
989
     * Set a callable that will will be used to transform column values.
990
     *
991
     * @param callable $callable
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
992
     *
993
     * @return void
994
     */
995
    public function setTransformColumnValueHook($callable)
0 ignored issues
show
introduced by
Type hint "callable" missing for $callable
Loading history...
996
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
997
        $this->transformColumnValueCallable = $callable;
998
    }
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 setTransformColumnValueHook()
Loading history...
999
1000
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $row should have a doc-comment as per coding-style.
Loading history...
1001
     * Give extending classes an opportunity to transform column values
1002
     *
1003
     * @param string $tableName Name of table which contains rows
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
1004
     * @param string $colName Name of the column in question
0 ignored issues
show
Coding Style introduced by
Expected 3 spaces after parameter name; 1 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
1005
     * @param string $colValue Value of the column in question
0 ignored issues
show
Coding Style introduced by
Expected 2 spaces after parameter name; 1 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
1006
     *
1007
     * @return string
1008
     */
1009
    protected function hookTransformColumnValue($tableName, $colName, $colValue, $row)
1010
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1011
        if (!$this->transformColumnValueCallable) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1012
            return $colValue;
1013
        }
1014
1015
        return call_user_func_array($this->transformColumnValueCallable, array(
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1016
            $tableName,
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 74 spaces, but found 12.
Loading history...
1017
            $colName,
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 74 spaces, but found 12.
Loading history...
1018
            $colValue,
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 74 spaces, but found 12.
Loading history...
1019
            $row
0 ignored issues
show
Coding Style introduced by
There should be a trailing comma after the last value of an array declaration.
Loading history...
1020
        ));
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 73 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
1021
    }
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 hookTransformColumnValue()
Loading history...
1022
1023
    /**
1024
     * Table rows extractor
1025
     *
1026
     * @param string $tableName  Name of table to export
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter name; 2 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
1027
     *
1028
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
1029
     */
1030
    private function listValues($tableName)
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::listValues" must be prefixed with an underscore
Loading history...
1031
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1032
        $this->prepareListValues($tableName);
1033
1034
        $onlyOnce = 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...
1035
        $lineSize = 0;
1036
1037
        // colStmt is used to form a query to obtain row values
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...
1038
        $colStmt = $this->getColumnStmt($tableName);
1039
        // colNames is used to get the name of the columns when using complete-insert
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...
1040
        if ($this->dumpSettings['complete-insert']) {
1041
            $colNames = $this->getColumnNames($tableName);
1042
        }
1043
1044
        $stmt = "SELECT ".implode(",", $colStmt)." FROM `$tableName`";
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal SELECT 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 Comprehensibility introduced by
The string literal , does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $tableName 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...
1045
1046
        // Table specific conditions override the default 'where'
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
1047
        $condition = $this->getTableWhere($tableName);
1048
1049
        if ($condition) {
1050
            $stmt .= " WHERE {$condition}";
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $condition 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...
1051
        }
1052
1053
        $limit = $this->getTableLimit($tableName);
1054
1055
        if ($limit) {
1056
            $stmt .= " LIMIT {$limit}";
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $limit 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...
1057
        }
1058
1059
        $resultSet = $this->dbHandler->query($stmt);
1060
        $resultSet->setFetchMode(PDO::FETCH_ASSOC);
1061
1062
        $ignore = $this->dumpSettings['insert-ignore'] ? '  IGNORE' : '';
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
Inline IF statements are not allowed
Loading history...
Coding Style introduced by
Inline shorthand IF statement requires brackets around comparison
Loading history...
1063
1064
        $count = 0;
1065
        foreach ($resultSet as $row) {
1066
            $count++;
1067
            $vals = $this->prepareColumnValues($tableName, $row);
1068
            if ($onlyOnce || !$this->dumpSettings['extended-insert']) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1069
                if ($this->dumpSettings['complete-insert']) {
1070
                    $lineSize += $this->compressManager->write(
1071
                        "INSERT$ignore INTO `$tableName` (".
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $ignore 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 $tableName 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
Concat operator must not be surrounded by spaces
Loading history...
1072
                        implode(", ", $colNames).
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal , does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
Comprehensibility Best Practice introduced by
The variable $colNames does not seem to be defined for all execution paths leading up to this point.
Loading history...
1073
                        ") VALUES (".implode(",", $vals).")"
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal ) VALUES ( 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 Comprehensibility introduced by
The string literal , does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style 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...
1074
                    );
1075
                } else {
1076
                    $lineSize += $this->compressManager->write(
1077
                        "INSERT$ignore INTO `$tableName` VALUES (".implode(",", $vals).")"
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $ignore 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 $tableName 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 Comprehensibility introduced by
The string literal , does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style 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...
1078
                    );
1079
                }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1080
                $onlyOnce = 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...
1081
            } else {
1082
                $lineSize += $this->compressManager->write(",(".implode(",", $vals).")");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal ,( does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style Comprehensibility introduced by
The string literal , does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style 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...
1083
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1084
            if (($lineSize > $this->dumpSettings['net_buffer_length']) ||
1085
                    !$this->dumpSettings['extended-insert']) {
0 ignored issues
show
Coding Style introduced by
Multi-line IF statement not indented correctly; expected 16 spaces but found 20
Loading history...
Coding Style introduced by
Each line in a multi-line IF statement must begin with a boolean operator
Loading history...
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
Coding Style introduced by
Closing parenthesis of a multi-line IF statement must be on a new line
Loading history...
1086
                $onlyOnce = 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...
1087
                $lineSize = $this->compressManager->write(";".PHP_EOL);
0 ignored issues
show
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...
1088
            }
1089
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
Coding Style introduced by
End comment for long condition not found; expected "//end foreach"
Loading history...
1090
        $resultSet->closeCursor();
1091
1092
        if (!$onlyOnce) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1093
            $this->compressManager->write(";".PHP_EOL);
0 ignored issues
show
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...
1094
        }
1095
1096
        $this->endListValues($tableName, $count);
1097
    }
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 listValues()
Loading history...
1098
1099
    /**
1100
     * Table rows extractor, append information prior to dump
1101
     *
1102
     * @param string $tableName  Name of table to export
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter name; 2 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
1103
     *
1104
     * @return null
1105
     */
1106
    public function prepareListValues($tableName)
1107
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1108
        if (!$this->dumpSettings['skip-comments']) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1109
            $this->compressManager->write(
1110
                "--".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal -- does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1111
                "-- Dumping data for table `$tableName`".PHP_EOL.
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $tableName 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
Concat operator must not be surrounded by spaces
Loading history...
1112
                "--".PHP_EOL.PHP_EOL
0 ignored issues
show
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...
1113
            );
1114
        }
1115
1116
        if ($this->dumpSettings['single-transaction']) {
1117
            $this->dbHandler->exec($this->typeAdapter->setup_transaction());
1118
            $this->dbHandler->exec($this->typeAdapter->start_transaction());
1119
        }
1120
1121
        if ($this->dumpSettings['lock-tables']) {
1122
            $this->typeAdapter->lock_table($tableName);
1123
        }
1124
1125
        if ($this->dumpSettings['add-locks']) {
1126
            $this->compressManager->write(
1127
                $this->typeAdapter->start_add_lock_table($tableName)
1128
            );
1129
        }
1130
1131
        if ($this->dumpSettings['disable-keys']) {
1132
            $this->compressManager->write(
1133
                $this->typeAdapter->start_add_disable_keys($tableName)
1134
            );
1135
        }
1136
1137
        // Disable autocommit for faster reload
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
1138
        if ($this->dumpSettings['no-autocommit']) {
1139
            $this->compressManager->write(
1140
                $this->typeAdapter->start_disable_autocommit()
1141
            );
1142
        }
1143
1144
        return;
0 ignored issues
show
Coding Style introduced by
Empty return statement not required here
Loading history...
introduced by
Function return type is not void, but function is returning void here
Loading history...
1145
    }
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 prepareListValues()
Loading history...
1146
1147
    /**
1148
     * Table rows extractor, close locks and commits after dump
1149
     *
1150
     * @param string $tableName Name of table to export.
0 ignored issues
show
Coding Style introduced by
Expected 2 spaces after parameter type; 1 found
Loading history...
1151
     * @param integer    $count     Number of rows inserted.
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter type; 4 found
Loading history...
1152
     *
1153
     * @return void
1154
     */
1155
    public function endListValues($tableName, $count = 0)
1156
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1157
        if ($this->dumpSettings['disable-keys']) {
1158
            $this->compressManager->write(
1159
                $this->typeAdapter->end_add_disable_keys($tableName)
1160
            );
1161
        }
1162
1163
        if ($this->dumpSettings['add-locks']) {
1164
            $this->compressManager->write(
1165
                $this->typeAdapter->end_add_lock_table($tableName)
1166
            );
1167
        }
1168
1169
        if ($this->dumpSettings['single-transaction']) {
1170
            $this->dbHandler->exec($this->typeAdapter->commit_transaction());
1171
        }
1172
1173
        if ($this->dumpSettings['lock-tables']) {
1174
            $this->typeAdapter->unlock_table($tableName);
1175
        }
1176
1177
        // Commit to enable autocommit
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
1178
        if ($this->dumpSettings['no-autocommit']) {
1179
            $this->compressManager->write(
1180
                $this->typeAdapter->end_disable_autocommit()
1181
            );
1182
        }
1183
1184
        $this->compressManager->write(PHP_EOL);
1185
1186
        if (! $this->dumpSettings['skip-comments']) {
1187
            $this->compressManager->write(
1188
                "-- Dumped table `" . $tableName . "` with $count row(s)".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal -- Dumped table ` 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
Concat operator must not be surrounded by spaces
Loading history...
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $count 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...
1189
                '--'.PHP_EOL.PHP_EOL
1190
            );
1191
        }
1192
1193
        return;
0 ignored issues
show
Coding Style introduced by
Empty return statement not required here
Loading history...
1194
    }
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 endListValues()
Loading history...
1195
1196
    /**
1197
     * Build SQL List of all columns on current table which will be used for selecting
1198
     *
1199
     * @param string $tableName  Name of table to get columns
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter name; 2 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
1200
     *
1201
     * @return array SQL sentence with columns for select
1202
     */
1203
    public function getColumnStmt($tableName)
1204
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1205
        $colStmt = array();
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1206
        foreach ($this->tableColumnTypes[$tableName] as $colName => $colType) {
1207
            if ($colType['type'] == 'bit' && $this->dumpSettings['hex-blob']) {
0 ignored issues
show
Coding Style introduced by
Operator == prohibited; use === instead
Loading history...
1208
                $colStmt[] = "LPAD(HEX(`${colName}`),2,'0') AS `${colName}`";
1209
            } elseif ($colType['is_blob'] && $this->dumpSettings['hex-blob']) {
0 ignored issues
show
Coding Style introduced by
Usage of ELSEIF not allowed; use ELSE IF instead
Loading history...
1210
                $colStmt[] = "HEX(`${colName}`) AS `${colName}`";
1211
            } elseif ($colType['is_virtual']) {
0 ignored issues
show
Coding Style introduced by
Usage of ELSEIF not allowed; use ELSE IF instead
Loading history...
1212
                $this->dumpSettings['complete-insert'] = 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...
1213
                continue;
1214
            } else {
1215
                $colStmt[] = "`${colName}`";
1216
            }
1217
        }
1218
1219
        return $colStmt;
1220
    }
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 getColumnStmt()
Loading history...
1221
1222
    /**
1223
     * Build SQL List of all columns on current table which will be used for inserting
1224
     *
1225
     * @param string $tableName  Name of table to get columns
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter name; 2 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
1226
     *
1227
     * @return array columns for sql sentence for insert
1228
     */
1229
    public function getColumnNames($tableName)
1230
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1231
        $colNames = array();
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1232
        foreach ($this->tableColumnTypes[$tableName] as $colName => $colType) {
1233
            if ($colType['is_virtual']) {
1234
                $this->dumpSettings['complete-insert'] = 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...
1235
                continue;
1236
            } else {
1237
                $colNames[] = "`${colName}`";
1238
            }
1239
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1240
        return $colNames;
1241
    }
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 getColumnNames()
Loading history...
1242
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1243
1244
/**
1245
 * Enum with all available compression methods
1246
 *
1247
 */
0 ignored issues
show
Coding Style introduced by
Additional blank lines found at end of doc comment
Loading history...
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @author tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
1248
abstract class CompressMethod
0 ignored issues
show
Coding Style introduced by
Only one interface or class is allowed in a file
Loading history...
Coding Style introduced by
Only one class is allowed in a file
Loading history...
Coding Style introduced by
Class name doesn't match filename; expected "class Mysqldump"
Loading history...
1249
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class CompressMethod
Loading history...
1250
    public static $enums = array(
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1251
        "None",
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 28 spaces, but found 8.
Loading history...
Coding Style Comprehensibility introduced by
The string literal None 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...
1252
        "Gzip",
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 28 spaces, but found 8.
Loading history...
Coding Style Comprehensibility introduced by
The string literal Gzip 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...
1253
        "Bzip2"
0 ignored issues
show
Coding Style introduced by
There should be a trailing comma after the last value of an array declaration.
Loading history...
Coding Style Comprehensibility introduced by
The string literal Bzip2 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...
1254
    );
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 27 space(s), but found 4.
Loading history...
1255
1256
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
1257
     * @param string $c
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1258
     * @return boolean
1259
     */
1260
    public static function isValid($c)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
1261
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1262
        return in_array($c, self::$enums);
1263
    }
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 isValid()
Loading history...
1264
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1265
1266
abstract class CompressManagerFactory
0 ignored issues
show
Coding Style introduced by
Only one interface or class is allowed in a file
Loading history...
Coding Style introduced by
Only one class is allowed in a file
Loading history...
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
Coding Style introduced by
Class name doesn't match filename; expected "class Mysqldump"
Loading history...
1267
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class CompressManagerFactory
Loading history...
1268
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
1269
     * @param string $c
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1270
     * @return CompressBzip2|CompressGzip|CompressNone
1271
     */
0 ignored issues
show
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
1272
    public static function create($c)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 0 found
Loading history...
1273
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1274
        $c = ucfirst(strtolower($c));
1275
        if (!CompressMethod::isValid($c)) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1276
            throw new Exception("Compression method ($c) is not defined yet");
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $c 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...
1277
        }
1278
1279
        $method = __NAMESPACE__."\\"."Compress".$c;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal \\ does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style Comprehensibility introduced by
The string literal Compress 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...
1280
1281
        return new $method;
1282
    }
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 create()
Loading history...
1283
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1284
1285
class CompressBzip2 extends CompressManagerFactory
0 ignored issues
show
Coding Style introduced by
Only one interface or class is allowed in a file
Loading history...
Coding Style introduced by
Only one class is allowed in a file
Loading history...
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
Coding Style introduced by
Class name doesn't match filename; expected "class Mysqldump"
Loading history...
1286
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class CompressBzip2
Loading history...
1287
    private $fileHandler = null;
0 ignored issues
show
Coding Style introduced by
Private member variable "fileHandler" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "fileHandler" must be prefixed with an underscore
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...
1288
1289
    public function __construct()
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1290
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1291
        if (!function_exists("bzopen")) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
Coding Style Comprehensibility introduced by
The string literal bzopen 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...
1292
            throw new Exception("Compression is enabled, but bzip2 lib is not installed or configured properly");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Compression is enabled, ... or configured properly 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 113 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...
1293
        }
1294
    }
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 __construct()
Loading history...
1295
1296
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
1297
     * @param string $filename
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1298
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
1299
    public function open($filename)
1300
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1301
        $this->fileHandler = bzopen($filename, "w");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal w 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...
1302
        if (false === $this->fileHandler) {
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...
1303
            throw new Exception("Output file is not writable");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Output file is not writable 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...
1304
        }
1305
1306
        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...
1307
    }
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 open()
Loading history...
1308
1309
    public function write($str)
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
1310
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1311
        if (false === ($bytesWritten = bzwrite($this->fileHandler, $str))) {
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
Assignments must be the first block of code on a line
Loading history...
1312
            throw new Exception("Writting to file failed! Probably, there is no more free space left?");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Writting to file failed!...o more free space left? 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 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...
1313
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1314
        return $bytesWritten;
1315
    }
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 write()
Loading history...
1316
1317
    public function close()
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
1318
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1319
        return bzclose($this->fileHandler);
1320
    }
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 close()
Loading history...
1321
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1322
1323
class CompressGzip extends CompressManagerFactory
0 ignored issues
show
Coding Style introduced by
Only one interface or class is allowed in a file
Loading history...
Coding Style introduced by
Only one class is allowed in a file
Loading history...
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
Coding Style introduced by
Class name doesn't match filename; expected "class Mysqldump"
Loading history...
1324
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class CompressGzip
Loading history...
1325
    private $fileHandler = null;
0 ignored issues
show
Coding Style introduced by
Private member variable "fileHandler" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "fileHandler" must be prefixed with an underscore
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...
1326
1327
    public function __construct()
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1328
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1329
        if (!function_exists("gzopen")) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
Coding Style Comprehensibility introduced by
The string literal gzopen 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...
1330
            throw new Exception("Compression is enabled, but gzip lib is not installed or configured properly");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Compression is enabled, ... or configured properly 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 112 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...
1331
        }
1332
    }
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 __construct()
Loading history...
1333
1334
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
1335
     * @param string $filename
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1336
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
1337
    public function open($filename)
1338
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1339
        $this->fileHandler = gzopen($filename, "wb");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal wb 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...
1340
        if (false === $this->fileHandler) {
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...
1341
            throw new Exception("Output file is not writable");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Output file is not writable 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...
1342
        }
1343
1344
        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...
1345
    }
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 open()
Loading history...
1346
1347
    public function write($str)
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
1348
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1349
        if (false === ($bytesWritten = gzwrite($this->fileHandler, $str))) {
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
Assignments must be the first block of code on a line
Loading history...
1350
            throw new Exception("Writting to file failed! Probably, there is no more free space left?");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Writting to file failed!...o more free space left? 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 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...
1351
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1352
        return $bytesWritten;
1353
    }
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 write()
Loading history...
1354
1355
    public function close()
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
1356
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1357
        return gzclose($this->fileHandler);
1358
    }
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 close()
Loading history...
1359
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1360
1361
class CompressNone extends CompressManagerFactory
0 ignored issues
show
Coding Style introduced by
Only one interface or class is allowed in a file
Loading history...
Coding Style introduced by
Only one class is allowed in a file
Loading history...
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
Coding Style introduced by
Class name doesn't match filename; expected "class Mysqldump"
Loading history...
1362
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class CompressNone
Loading history...
1363
    private $fileHandler = null;
0 ignored issues
show
Coding Style introduced by
Private member variable "fileHandler" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "fileHandler" must be prefixed with an underscore
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...
1364
1365
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
1366
     * @param string $filename
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1367
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
1368
    public function open($filename)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
1369
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1370
        $this->fileHandler = fopen($filename, "wb");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal wb 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...
1371
        if (false === $this->fileHandler) {
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...
1372
            throw new Exception("Output file is not writable");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Output file is not writable 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...
1373
        }
1374
1375
        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...
1376
    }
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 open()
Loading history...
1377
1378
    public function write($str)
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
1379
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1380
        if (false === ($bytesWritten = fwrite($this->fileHandler, $str))) {
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
Assignments must be the first block of code on a line
Loading history...
1381
            throw new Exception("Writting to file failed! Probably, there is no more free space left?");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Writting to file failed!...o more free space left? 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 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...
1382
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1383
        return $bytesWritten;
1384
    }
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 write()
Loading history...
1385
1386
    public function close()
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
1387
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1388
        return fclose($this->fileHandler);
1389
    }
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 close()
Loading history...
1390
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1391
1392
/**
1393
 * Enum with all available TypeAdapter implementations
1394
 *
1395
 */
0 ignored issues
show
Coding Style introduced by
Additional blank lines found at end of doc comment
Loading history...
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @author tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
1396
abstract class TypeAdapter
0 ignored issues
show
Coding Style introduced by
Only one interface or class is allowed in a file
Loading history...
Coding Style introduced by
Only one class is allowed in a file
Loading history...
Coding Style introduced by
Class name doesn't match filename; expected "class Mysqldump"
Loading history...
1397
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class TypeAdapter
Loading history...
1398
    public static $enums = array(
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1399
        "Sqlite",
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 28 spaces, but found 8.
Loading history...
Coding Style Comprehensibility introduced by
The string literal Sqlite 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...
1400
        "Mysql"
0 ignored issues
show
Coding Style introduced by
There should be a trailing comma after the last value of an array declaration.
Loading history...
Coding Style Comprehensibility introduced by
The string literal Mysql 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...
1401
    );
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 27 space(s), but found 4.
Loading history...
1402
1403
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
1404
     * @param string $c
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1405
     * @return boolean
1406
     */
1407
    public static function isValid($c)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
1408
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1409
        return in_array($c, self::$enums);
1410
    }
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 isValid()
Loading history...
1411
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1412
1413
/**
1414
 * TypeAdapter Factory
1415
 *
1416
 */
0 ignored issues
show
Coding Style introduced by
Additional blank lines found at end of doc comment
Loading history...
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @author tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
1417
abstract class TypeAdapterFactory
0 ignored issues
show
Coding Style introduced by
Only one interface or class is allowed in a file
Loading history...
Coding Style introduced by
Only one class is allowed in a file
Loading history...
Coding Style introduced by
Class name doesn't match filename; expected "class Mysqldump"
Loading history...
1418
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class TypeAdapterFactory
Loading history...
1419
    protected $dbHandler = null;
0 ignored issues
show
Coding Style introduced by
Protected member variable "dbHandler" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line 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 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...
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...
1420
    protected $dumpSettings = array();
0 ignored issues
show
Coding Style introduced by
Protected member variable "dumpSettings" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1421
1422
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
Parameter $dumpSettings should have a doc-comment as per coding-style.
Loading history...
1423
     * @param string $c Type of database factory to create (Mysql, Sqlite,...)
0 ignored issues
show
Coding Style introduced by
Expected 9 spaces after parameter name; 1 found
Loading history...
introduced by
Parameter comment must end with a full stop
Loading history...
1424
     * @param PDO $dbHandler
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 4 spaces after parameter type; 1 found
Loading history...
1425
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
1426
    public static function create($c, $dbHandler = null, $dumpSettings = array())
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
introduced by
Type hint "PDO" missing for $dbHandler
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...
1427
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1428
        $c = ucfirst(strtolower($c));
1429
        if (!TypeAdapter::isValid($c)) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1430
            throw new Exception("Database type support for ($c) not yet available");
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $c 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...
1431
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1432
        $method = __NAMESPACE__."\\"."TypeAdapter".$c;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal \\ does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style Comprehensibility introduced by
The string literal TypeAdapter 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...
1433
        return new $method($dbHandler, $dumpSettings);
1434
    }
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 create()
Loading history...
1435
1436
    public function __construct($dbHandler = null, $dumpSettings = array())
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1437
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1438
        $this->dbHandler = $dbHandler;
0 ignored issues
show
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...
1439
        $this->dumpSettings = $dumpSettings;
1440
    }
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 __construct()
Loading history...
1441
1442
    /**
1443
     * function databases Add sql to create and use database
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
1444
     * @todo make it do something with sqlite
0 ignored issues
show
Coding Style introduced by
Comment refers to a TODO task

This check looks TODO comments that have been left in the code.

``TODO``s show that something is left unfinished and should be attended to.

Loading history...
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
1445
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
1446
    public function databases()
1447
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1448
        return "";
0 ignored issues
show
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...
1449
    }
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 databases()
Loading history...
1450
1451
    public function show_create_table($tableName)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::show_create_table" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1452
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1453
        return "SELECT tbl_name as 'Table', sql as 'Create Table' ".
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1454
            "FROM sqlite_master ".
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal FROM sqlite_master 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
Concat operator must not be surrounded by spaces
Loading history...
1455
            "WHERE type='table' AND tbl_name='$tableName'";
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $tableName 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...
1456
    }
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 show_create_table()
Loading history...
1457
1458
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $row should have a doc-comment as per coding-style.
Loading history...
1459
     * function create_table Get table creation code from database
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
1460
     * @todo make it do something with sqlite
0 ignored issues
show
Coding Style introduced by
Comment refers to a TODO task

This check looks TODO comments that have been left in the code.

``TODO``s show that something is left unfinished and should be attended to.

Loading history...
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
1461
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
1462
    public function create_table($row)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::create_table" is not in camel caps format
Loading history...
1463
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1464
        return "";
0 ignored issues
show
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...
1465
    }
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 create_table()
Loading history...
1466
1467
    public function show_create_view($viewName)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::show_create_view" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1468
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1469
        return "SELECT tbl_name as 'View', sql as 'Create View' ".
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1470
            "FROM sqlite_master ".
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal FROM sqlite_master 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
Concat operator must not be surrounded by spaces
Loading history...
1471
            "WHERE type='view' AND tbl_name='$viewName'";
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $viewName 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...
1472
    }
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 show_create_view()
Loading history...
1473
1474
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $row should have a doc-comment as per coding-style.
Loading history...
1475
     * function create_view Get view creation code from database
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
1476
     * @todo make it do something with sqlite
0 ignored issues
show
Coding Style introduced by
Comment refers to a TODO task

This check looks TODO comments that have been left in the code.

``TODO``s show that something is left unfinished and should be attended to.

Loading history...
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
1477
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
1478
    public function create_view($row)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::create_view" is not in camel caps format
Loading history...
1479
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1480
        return "";
0 ignored issues
show
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...
1481
    }
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 create_view()
Loading history...
1482
1483
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $triggerName should have a doc-comment as per coding-style.
Loading history...
1484
     * function show_create_trigger Get trigger creation code from database
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
1485
     * @todo make it do something with sqlite
0 ignored issues
show
Coding Style introduced by
Comment refers to a TODO task

This check looks TODO comments that have been left in the code.

``TODO``s show that something is left unfinished and should be attended to.

Loading history...
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
1486
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
1487
    public function show_create_trigger($triggerName)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::show_create_trigger" is not in camel caps format
Loading history...
1488
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1489
        return "";
0 ignored issues
show
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...
1490
    }
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 show_create_trigger()
Loading history...
1491
1492
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $triggerName should have a doc-comment as per coding-style.
Loading history...
1493
     * function create_trigger Modify trigger code, add delimiters, etc
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
1494
     * @todo make it do something with sqlite
0 ignored issues
show
Coding Style introduced by
Comment refers to a TODO task

This check looks TODO comments that have been left in the code.

``TODO``s show that something is left unfinished and should be attended to.

Loading history...
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
1495
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
1496
    public function create_trigger($triggerName)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::create_trigger" is not in camel caps format
Loading history...
1497
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1498
        return "";
0 ignored issues
show
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...
1499
    }
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 create_trigger()
Loading history...
1500
1501
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $procedureName should have a doc-comment as per coding-style.
Loading history...
1502
     * function create_procedure Modify procedure code, add delimiters, etc
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
1503
     * @todo make it do something with sqlite
0 ignored issues
show
Coding Style introduced by
Comment refers to a TODO task

This check looks TODO comments that have been left in the code.

``TODO``s show that something is left unfinished and should be attended to.

Loading history...
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
1504
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
1505
    public function create_procedure($procedureName)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::create_procedure" is not in camel caps format
Loading history...
1506
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1507
        return "";
0 ignored issues
show
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...
1508
    }
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 create_procedure()
Loading history...
1509
1510
    public function show_tables()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::show_tables" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1511
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1512
        return "SELECT tbl_name FROM sqlite_master WHERE type='table'";
1513
    }
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 show_tables()
Loading history...
1514
1515
    public function show_views()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::show_views" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1516
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1517
        return "SELECT tbl_name FROM sqlite_master WHERE type='view'";
1518
    }
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 show_views()
Loading history...
1519
1520
    public function show_triggers()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::show_triggers" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1521
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1522
        return "SELECT name FROM sqlite_master WHERE type='trigger'";
1523
    }
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 show_triggers()
Loading history...
1524
1525
    public function show_columns()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::show_columns" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1526
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1527
        if (func_num_args() != 1) {
0 ignored issues
show
Coding Style introduced by
Operator != prohibited; use !== instead
Loading history...
1528
            return "";
0 ignored issues
show
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...
1529
        }
1530
1531
        $args = func_get_args();
1532
1533
        return "pragma table_info(${args[0]})";
1534
    }
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 show_columns()
Loading history...
1535
1536
    public function show_procedures()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::show_procedures" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1537
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1538
        return "";
0 ignored issues
show
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...
1539
    }
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 show_procedures()
Loading history...
1540
1541
    public function show_events()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::show_events" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1542
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1543
        return "";
0 ignored issues
show
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...
1544
    }
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 show_events()
Loading history...
1545
1546
    public function setup_transaction()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::setup_transaction" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1547
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1548
        return "";
0 ignored issues
show
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...
1549
    }
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 setup_transaction()
Loading history...
1550
1551
    public function start_transaction()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::start_transaction" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1552
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1553
        return "BEGIN EXCLUSIVE";
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal BEGIN EXCLUSIVE 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...
1554
    }
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 start_transaction()
Loading history...
1555
1556
    public function commit_transaction()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::commit_transaction" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1557
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1558
        return "COMMIT";
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal COMMIT 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...
1559
    }
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 commit_transaction()
Loading history...
1560
1561
    public function lock_table()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::lock_table" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1562
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1563
        return "";
0 ignored issues
show
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...
1564
    }
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 lock_table()
Loading history...
1565
1566
    public function unlock_table()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::unlock_table" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1567
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1568
        return "";
0 ignored issues
show
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...
1569
    }
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 unlock_table()
Loading history...
1570
1571
    public function start_add_lock_table()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::start_add_lock_table" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1572
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1573
        return PHP_EOL;
1574
    }
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 start_add_lock_table()
Loading history...
1575
1576
    public function end_add_lock_table()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::end_add_lock_table" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1577
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1578
        return PHP_EOL;
1579
    }
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 end_add_lock_table()
Loading history...
1580
1581
    public function start_add_disable_keys()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::start_add_disable_keys" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1582
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1583
        return PHP_EOL;
1584
    }
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 start_add_disable_keys()
Loading history...
1585
1586
    public function end_add_disable_keys()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::end_add_disable_keys" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1587
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1588
        return PHP_EOL;
1589
    }
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 end_add_disable_keys()
Loading history...
1590
1591
    public function start_disable_foreign_keys_check()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::start_disable_foreign_keys_check" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1592
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1593
        return PHP_EOL;
1594
    }
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 start_disable_foreign_keys_check()
Loading history...
1595
1596
    public function end_disable_foreign_keys_check()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::end_disable_foreign_keys_check" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1597
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1598
        return PHP_EOL;
1599
    }
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 end_disable_foreign_keys_check()
Loading history...
1600
1601
    public function add_drop_database()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::add_drop_database" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1602
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1603
        return PHP_EOL;
1604
    }
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 add_drop_database()
Loading history...
1605
1606
    public function add_drop_trigger()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::add_drop_trigger" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1607
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1608
        return PHP_EOL;
1609
    }
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 add_drop_trigger()
Loading history...
1610
1611
    public function drop_table()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::drop_table" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1612
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1613
        return PHP_EOL;
1614
    }
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 drop_table()
Loading history...
1615
1616
    public function drop_view()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::drop_view" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1617
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1618
        return PHP_EOL;
1619
    }
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 drop_view()
Loading history...
1620
1621
    /**
1622
     * Decode column metadata and fill info structure.
1623
     * type, is_numeric and is_blob will always be available.
1624
     *
1625
     * @param array $colType Array returned from "SHOW COLUMNS FROM tableName"
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
1626
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
1627
     */
1628
    public function parseColumnType($colType)
0 ignored issues
show
Unused Code introduced by
The method parameter $colType is never used
Loading history...
introduced by
Type hint "array" missing for $colType
Loading history...
1629
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1630
        return array();
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1631
    }
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 parseColumnType()
Loading history...
1632
1633
    public function backup_parameters()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::backup_parameters" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1634
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1635
        return PHP_EOL;
1636
    }
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 backup_parameters()
Loading history...
1637
1638
    public function restore_parameters()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::restore_parameters" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1639
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1640
        return PHP_EOL;
1641
    }
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 restore_parameters()
Loading history...
1642
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1643
1644
class TypeAdapterPgsql extends TypeAdapterFactory
0 ignored issues
show
Coding Style introduced by
Only one interface or class is allowed in a file
Loading history...
Coding Style introduced by
Only one class is allowed in a file
Loading history...
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
Coding Style introduced by
Class name doesn't match filename; expected "class Mysqldump"
Loading history...
1645
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class TypeAdapterPgsql
Loading history...
1646
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1647
1648
class TypeAdapterDblib extends TypeAdapterFactory
0 ignored issues
show
Coding Style introduced by
Only one interface or class is allowed in a file
Loading history...
Coding Style introduced by
Only one class is allowed in a file
Loading history...
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
Coding Style introduced by
Class name doesn't match filename; expected "class Mysqldump"
Loading history...
1649
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class TypeAdapterDblib
Loading history...
1650
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1651
1652
class TypeAdapterSqlite extends TypeAdapterFactory
0 ignored issues
show
Coding Style introduced by
Only one interface or class is allowed in a file
Loading history...
Coding Style introduced by
Only one class is allowed in a file
Loading history...
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
Coding Style introduced by
Class name doesn't match filename; expected "class Mysqldump"
Loading history...
1653
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class TypeAdapterSqlite
Loading history...
1654
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1655
1656
class TypeAdapterMysql extends TypeAdapterFactory
0 ignored issues
show
Coding Style introduced by
Only one interface or class is allowed in a file
Loading history...
Coding Style introduced by
Only one class is allowed in a file
Loading history...
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
Coding Style introduced by
Class name doesn't match filename; expected "class Mysqldump"
Loading history...
1657
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class TypeAdapterMysql
Loading history...
1658
    const DEFINER_RE = 'DEFINER=`(?:[^`]|``)*`@`(?:[^`]|``)*`';
1659
1660
1661
    // Numerical Mysql types
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
1662
    public $mysqlTypes = array(
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before member var; 2 found
Loading history...
Coding Style introduced by
You must use "/**" style comments for a member variable comment
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1663
        'numerical' => array(
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 26 spaces, but found 8.
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1664
            'bit',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 24 spaces, but found 12.
Loading history...
1665
            'tinyint',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 24 spaces, but found 12.
Loading history...
1666
            'smallint',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 24 spaces, but found 12.
Loading history...
1667
            'mediumint',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 24 spaces, but found 12.
Loading history...
1668
            'int',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 24 spaces, but found 12.
Loading history...
1669
            'integer',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 24 spaces, but found 12.
Loading history...
1670
            'bigint',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 24 spaces, but found 12.
Loading history...
1671
            'real',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 24 spaces, but found 12.
Loading history...
1672
            'double',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 24 spaces, but found 12.
Loading history...
1673
            'float',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 24 spaces, but found 12.
Loading history...
1674
            'decimal',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 24 spaces, but found 12.
Loading history...
1675
            'numeric'
0 ignored issues
show
Coding Style introduced by
There should be a trailing comma after the last value of an array declaration.
Loading history...
1676
        ),
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 23 space(s), but found 8.
Loading history...
1677
        'blob' => array(
0 ignored issues
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 26 spaces, but found 8.
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1678
            'tinyblob',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
1679
            'blob',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
1680
            'mediumblob',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
1681
            'longblob',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
1682
            'binary',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
1683
            'varbinary',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
1684
            'bit',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
1685
            'geometry', /* http://bugs.mysql.com/bug.php?id=43544 */
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
1686
            'point',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
1687
            'linestring',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
1688
            'polygon',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
1689
            'multipoint',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
1690
            'multilinestring',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
1691
            'multipolygon',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
1692
            'geometrycollection',
0 ignored issues
show
Coding Style introduced by
This array value does not seem to be aligned correcty; expected 19 spaces, but found 12.
Loading history...
1693
        )
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 18 space(s), but found 8.
Loading history...
1694
    );
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 25 space(s), but found 4.
Loading history...
1695
1696
    public function databases()
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1697
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1698
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
1699
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
1700
        $databaseName = $args[0];
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 47 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...
1701
1702
        $resultSet = $this->dbHandler->query("SHOW VARIABLES LIKE 'character_set_database';");
0 ignored issues
show
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...
1703
        $characterSet = $resultSet->fetchColumn(1);
1704
        $resultSet->closeCursor();
1705
1706
        $resultSet = $this->dbHandler->query("SHOW VARIABLES LIKE 'collation_database';");
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...
1707
        $collationDb = $resultSet->fetchColumn(1);
1708
        $resultSet->closeCursor();
1709
        $ret = "";
0 ignored issues
show
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...
1710
1711
        $ret .= "CREATE DATABASE /*!32312 IF NOT EXISTS*/ `${databaseName}`".
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1712
            " /*!40100 DEFAULT CHARACTER SET ${characterSet} ".
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1713
            " COLLATE ${collationDb} */;".PHP_EOL.PHP_EOL.
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1714
            "USE `${databaseName}`;".PHP_EOL.PHP_EOL;
1715
1716
        return $ret;
1717
    }
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 databases()
Loading history...
1718
1719
    public function show_create_table($tableName)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::show_create_table" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1720
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1721
        return "SHOW CREATE TABLE `$tableName`";
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $tableName 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...
1722
    }
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 show_create_table()
Loading history...
1723
1724
    public function show_create_view($viewName)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::show_create_view" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1725
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1726
        return "SHOW CREATE VIEW `$viewName`";
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $viewName 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...
1727
    }
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 show_create_view()
Loading history...
1728
1729
    public function show_create_trigger($triggerName)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::show_create_trigger" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1730
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1731
        return "SHOW CREATE TRIGGER `$triggerName`";
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $triggerName 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...
1732
    }
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 show_create_trigger()
Loading history...
1733
1734
    public function show_create_procedure($procedureName)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::show_create_procedure" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1735
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1736
        return "SHOW CREATE PROCEDURE `$procedureName`";
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $procedureName 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...
1737
    }
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 show_create_procedure()
Loading history...
1738
1739
    public function show_create_event($eventName)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::show_create_event" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1740
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1741
        return "SHOW CREATE EVENT `$eventName`";
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $eventName 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...
1742
    }
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 show_create_event()
Loading history...
1743
1744
    public function create_table($row)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::create_table" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1745
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1746
        if (!isset($row['Create Table'])) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1747
            throw new Exception("Error getting table code, unknown output");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Error getting table code, unknown output 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...
1748
        }
1749
1750
        $createTable = $row['Create Table'];
1751
        if ($this->dumpSettings['reset-auto-increment']) {
1752
            $match = "/AUTO_INCREMENT=[0-9]+/s";
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 7 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 /AUTO_INCREMENT=[0-9]+/s 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...
1753
            $replace = "";
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 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...
1754
            $createTable = preg_replace($match, $replace, $createTable);
1755
        }
1756
1757
        $ret = "/*!40101 SET @saved_cs_client     = @@character_set_client */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET @saved_cs_c...haracter_set_client */; 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
Concat operator must not be surrounded by spaces
Loading history...
1758
            "/*!40101 SET character_set_client = ".$this->dumpSettings['default-character-set']." */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET character_set_client = 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 Comprehensibility introduced by
The string literal */; does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 111 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
Concat operator must not be surrounded by spaces
Loading history...
1759
            $createTable.";".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal ; does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1760
            "/*!40101 SET character_set_client = @saved_cs_client */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET character_s... = @saved_cs_client */; 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
Concat operator must not be surrounded by spaces
Loading history...
1761
            PHP_EOL;
1762
        return $ret;
1763
    }
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 create_table()
Loading history...
1764
1765
    public function create_view($row)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::create_view" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1766
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1767
        $ret = "";
0 ignored issues
show
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...
1768
        if (!isset($row['Create View'])) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1769
            throw new Exception("Error getting view structure, unknown output");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Error getting view structure, unknown output 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...
1770
        }
1771
1772
        $viewStmt = $row['Create View'];
1773
1774
        $definerStr = $this->dumpSettings['skip-definer'] ? '' : '/*!50013 \2 */'.PHP_EOL;
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
Inline IF statements are not allowed
Loading history...
Coding Style introduced by
Inline shorthand IF statement requires brackets around comparison
Loading history...
1775
1776
        if ($viewStmtReplaced = preg_replace(
0 ignored issues
show
Coding Style introduced by
Assignments must be the first block of code on a line
Loading history...
1777
            '/^(CREATE(?:\s+ALGORITHM=(?:UNDEFINED|MERGE|TEMPTABLE))?)\s+('
1778
            .self::DEFINER_RE.'(?:\s+SQL SECURITY DEFINER|INVOKER)?)?\s+(VIEW .+)$/',
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1779
            '/*!50001 \1 */'.PHP_EOL.$definerStr.'/*!50001 \3 */',
1780
            $viewStmt,
1781
            1
1782
        )) {
0 ignored issues
show
Coding Style introduced by
Closing parenthesis of a multi-line IF statement must be on a new line
Loading history...
1783
            $viewStmt = $viewStmtReplaced;
1784
        };
1785
1786
        $ret .= $viewStmt.';'.PHP_EOL.PHP_EOL;
1787
        return $ret;
1788
    }
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 create_view()
Loading history...
1789
1790
    public function create_trigger($row)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::create_trigger" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1791
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1792
        $ret = "";
0 ignored issues
show
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...
1793
        if (!isset($row['SQL Original Statement'])) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1794
            throw new Exception("Error getting trigger code, unknown output");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Error getting trigger code, unknown output 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...
1795
        }
1796
1797
        $triggerStmt = $row['SQL Original Statement'];
1798
        $definerStr = $this->dumpSettings['skip-definer'] ? '' : '/*!50017 \2*/ ';
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
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...
Coding Style introduced by
Inline shorthand IF statement requires brackets around comparison
Loading history...
1799
        if ($triggerStmtReplaced = preg_replace(
0 ignored issues
show
Coding Style introduced by
Assignments must be the first block of code on a line
Loading history...
1800
            '/^(CREATE)\s+('.self::DEFINER_RE.')?\s+(TRIGGER\s.*)$/s',
1801
            '/*!50003 \1*/ '.$definerStr.'/*!50003 \3 */',
1802
            $triggerStmt,
1803
            1
1804
        )) {
0 ignored issues
show
Coding Style introduced by
Closing parenthesis of a multi-line IF statement must be on a new line
Loading history...
1805
            $triggerStmt = $triggerStmtReplaced;
1806
        }
1807
1808
        $ret .= "DELIMITER ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal DELIMITER ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1809
            $triggerStmt.";;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal ;; does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1810
            "DELIMITER ;".PHP_EOL.PHP_EOL;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal DELIMITER ; 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...
1811
        return $ret;
1812
    }
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 create_trigger()
Loading history...
1813
1814
    public function create_procedure($row)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::create_procedure" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1815
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1816
        $ret = "";
0 ignored issues
show
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...
1817
        if (!isset($row['Create Procedure'])) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1818
            throw new Exception("Error getting procedure code, unknown output. ".
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style Comprehensibility introduced by
The string literal Error getting procedure code, unknown output. 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
Concat operator must not be surrounded by spaces
Loading history...
1819
                "Please check 'https://bugs.mysql.com/bug.php?id=14564'");
0 ignored issues
show
Coding Style introduced by
This line of the multi-line function call does not seem to be indented correctly. Expected 12 spaces, but found 16.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
1820
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1821
        $procedureStmt = $row['Create Procedure'];
1822
1823
        $ret .= "/*!50003 DROP PROCEDURE IF EXISTS `".
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 DROP PROCEDURE IF EXISTS ` 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
Concat operator must not be surrounded by spaces
Loading history...
1824
            $row['Procedure']."` */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal ` */; does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1825
            "/*!40101 SET @saved_cs_client     = @@character_set_client */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET @saved_cs_c...haracter_set_client */; 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
Concat operator must not be surrounded by spaces
Loading history...
1826
            "/*!40101 SET character_set_client = ".$this->dumpSettings['default-character-set']." */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET character_set_client = 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 Comprehensibility introduced by
The string literal */; does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 111 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
Concat operator must not be surrounded by spaces
Loading history...
1827
            "DELIMITER ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal DELIMITER ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1828
            $procedureStmt." ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal ;; does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1829
            "DELIMITER ;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal DELIMITER ; 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
Concat operator must not be surrounded by spaces
Loading history...
1830
            "/*!40101 SET character_set_client = @saved_cs_client */;".PHP_EOL.PHP_EOL;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET character_s... = @saved_cs_client */; 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...
1831
1832
        return $ret;
1833
    }
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 create_procedure()
Loading history...
1834
1835
    public function create_event($row)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::create_event" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1836
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1837
        $ret = "";
0 ignored issues
show
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...
1838
        if (!isset($row['Create Event'])) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1839
            throw new Exception("Error getting event code, unknown output. ".
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style Comprehensibility introduced by
The string literal Error getting event code, unknown output. 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
Concat operator must not be surrounded by spaces
Loading history...
1840
                "Please check 'http://stackoverflow.com/questions/10853826/mysql-5-5-create-event-gives-syntax-error'");
0 ignored issues
show
Coding Style introduced by
This line of the multi-line function call does not seem to be indented correctly. Expected 12 spaces, but found 16.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 120 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...
1841
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1842
        $eventName = $row['Event'];
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...
1843
        $eventStmt = $row['Create Event'];
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...
1844
        $sqlMode = $row['sql_mode'];
0 ignored issues
show
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...
1845
        $definerStr = $this->dumpSettings['skip-definer'] ? '' : '/*!50117 \2*/ ';
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
Inline IF statements are not allowed
Loading history...
Coding Style introduced by
Inline shorthand IF statement requires brackets around comparison
Loading history...
1846
1847
        if ($eventStmtReplaced = preg_replace(
0 ignored issues
show
Coding Style introduced by
Assignments must be the first block of code on a line
Loading history...
1848
            '/^(CREATE)\s+('.self::DEFINER_RE.')?\s+(EVENT .*)$/',
1849
            '/*!50106 \1*/ '.$definerStr.'/*!50106 \3 */',
1850
            $eventStmt,
1851
            1
1852
        )) {
0 ignored issues
show
Coding Style introduced by
Closing parenthesis of a multi-line IF statement must be on a new line
Loading history...
1853
            $eventStmt = $eventStmtReplaced;
1854
        }
1855
1856
        $ret .= "/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50106 SET @save_time_zone= @@TIME_ZONE */ ; 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
Concat operator must not be surrounded by spaces
Loading history...
1857
            "/*!50106 DROP EVENT IF EXISTS `".$eventName."` */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50106 DROP EVENT IF EXISTS ` 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 Comprehensibility introduced by
The string literal ` */; does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1858
            "DELIMITER ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal DELIMITER ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1859
            "/*!50003 SET @saved_cs_client      = @@character_set_client */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 SET @saved_cs_c...racter_set_client */ ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1860
            "/*!50003 SET @saved_cs_results     = @@character_set_results */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 SET @saved_cs_r...acter_set_results */ ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1861
            "/*!50003 SET @saved_col_connection = @@collation_connection */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 SET @saved_col_...lation_connection */ ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1862
            "/*!50003 SET character_set_client  = utf8 */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 SET character_set_client = utf8 */ ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1863
            "/*!50003 SET character_set_results = utf8 */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 SET character_set_results = utf8 */ ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1864
            "/*!50003 SET collation_connection  = utf8_general_ci */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 SET collation_c...= utf8_general_ci */ ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1865
            "/*!50003 SET @saved_sql_mode       = @@sql_mode */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 SET @saved_sql_... = @@sql_mode */ ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1866
            "/*!50003 SET sql_mode              = '".$sqlMode."' */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1867
            "/*!50003 SET @saved_time_zone      = @@time_zone */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 SET @saved_time... = @@time_zone */ ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1868
            "/*!50003 SET time_zone             = 'SYSTEM' */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1869
            $eventStmt." ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal ;; does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1870
            "/*!50003 SET time_zone             = @saved_time_zone */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 SET time_zone ... @saved_time_zone */ ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1871
            "/*!50003 SET sql_mode              = @saved_sql_mode */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 SET sql_mode ...= @saved_sql_mode */ ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1872
            "/*!50003 SET character_set_client  = @saved_cs_client */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 SET character_s... @saved_cs_client */ ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1873
            "/*!50003 SET character_set_results = @saved_cs_results */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 SET character_s...@saved_cs_results */ ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1874
            "/*!50003 SET collation_connection  = @saved_col_connection */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 SET collation_c...ed_col_connection */ ;; 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
Concat operator must not be surrounded by spaces
Loading history...
1875
            "DELIMITER ;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal DELIMITER ; 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
Concat operator must not be surrounded by spaces
Loading history...
1876
            "/*!50106 SET TIME_ZONE= @save_time_zone */ ;".PHP_EOL.PHP_EOL;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50106 SET TIME_ZONE= @save_time_zone */ ; 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...
1877
            // Commented because we are doing this in restore_parameters()
1878
            // "/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;" . PHP_EOL . PHP_EOL;
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
Coding Style introduced by
There should be no blank line after an inline comment.
Loading history...
1879
1880
        return $ret;
1881
    }
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 create_event()
Loading history...
1882
1883
    public function show_tables()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::show_tables" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1884
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1885
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
1886
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
1887
        return "SELECT TABLE_NAME AS tbl_name ".
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal SELECT TABLE_NAME AS tbl_name 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
Concat operator must not be surrounded by spaces
Loading history...
1888
            "FROM INFORMATION_SCHEMA.TABLES ".
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal FROM INFORMATION_SCHEMA.TABLES 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
Concat operator must not be surrounded by spaces
Loading history...
1889
            "WHERE TABLE_TYPE='BASE TABLE' AND TABLE_SCHEMA='${args[0]}'";
1890
    }
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 show_tables()
Loading history...
1891
1892
    public function show_views()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::show_views" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1893
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1894
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
1895
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
1896
        return "SELECT TABLE_NAME AS tbl_name ".
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal SELECT TABLE_NAME AS tbl_name 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
Concat operator must not be surrounded by spaces
Loading history...
1897
            "FROM INFORMATION_SCHEMA.TABLES ".
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal FROM INFORMATION_SCHEMA.TABLES 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
Concat operator must not be surrounded by spaces
Loading history...
1898
            "WHERE TABLE_TYPE='VIEW' AND TABLE_SCHEMA='${args[0]}'";
1899
    }
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 show_views()
Loading history...
1900
1901
    public function show_triggers()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::show_triggers" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1902
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1903
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
1904
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
1905
        return "SHOW TRIGGERS FROM `${args[0]}`;";
1906
    }
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 show_triggers()
Loading history...
1907
1908
    public function show_columns()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::show_columns" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1909
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1910
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
1911
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
1912
        return "SHOW COLUMNS FROM `${args[0]}`;";
1913
    }
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 show_columns()
Loading history...
1914
1915
    public function show_procedures()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::show_procedures" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1916
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1917
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
1918
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
1919
        return "SELECT SPECIFIC_NAME AS procedure_name ".
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal SELECT SPECIFIC_NAME AS procedure_name 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
Concat operator must not be surrounded by spaces
Loading history...
1920
            "FROM INFORMATION_SCHEMA.ROUTINES ".
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal FROM INFORMATION_SCHEMA.ROUTINES 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
Concat operator must not be surrounded by spaces
Loading history...
1921
            "WHERE ROUTINE_TYPE='PROCEDURE' AND ROUTINE_SCHEMA='${args[0]}'";
1922
    }
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 show_procedures()
Loading history...
1923
1924
    /**
1925
     * Get query string to ask for names of events from current database.
1926
     *
1927
     * @param string Name of database
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter name
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
Bug introduced by
The type Ifsnop\Mysqldump\Name was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
1928
     * @return string
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
1929
     */
1930
    public function show_events()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::show_events" is not in camel caps format
Loading history...
1931
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1932
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
1933
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
1934
        return "SELECT EVENT_NAME AS event_name ".
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal SELECT EVENT_NAME AS event_name 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
Concat operator must not be surrounded by spaces
Loading history...
1935
            "FROM INFORMATION_SCHEMA.EVENTS ".
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal FROM INFORMATION_SCHEMA.EVENTS 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
Concat operator must not be surrounded by spaces
Loading history...
1936
            "WHERE EVENT_SCHEMA='${args[0]}'";
1937
    }
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 show_events()
Loading history...
1938
1939
    public function setup_transaction()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::setup_transaction" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1940
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1941
        return "SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ";
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal SET SESSION TRANSACTION ...N LEVEL REPEATABLE READ 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...
1942
    }
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 setup_transaction()
Loading history...
1943
1944
    public function start_transaction()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::start_transaction" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1945
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1946
        return "START TRANSACTION";
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal START TRANSACTION 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...
1947
    }
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 start_transaction()
Loading history...
1948
1949
    public function commit_transaction()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::commit_transaction" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1950
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1951
        return "COMMIT";
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal COMMIT 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...
1952
    }
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 commit_transaction()
Loading history...
1953
1954
    public function lock_table()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::lock_table" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1955
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1956
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
1957
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
1958
        return $this->dbHandler->exec("LOCK TABLES `${args[0]}` READ LOCAL");
1959
    }
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 lock_table()
Loading history...
1960
1961
    public function unlock_table()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::unlock_table" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1962
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1963
        return $this->dbHandler->exec("UNLOCK TABLES");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal UNLOCK TABLES 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...
1964
    }
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 unlock_table()
Loading history...
1965
1966
    public function start_add_lock_table()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::start_add_lock_table" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1967
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1968
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
1969
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
1970
        return "LOCK TABLES `${args[0]}` WRITE;".PHP_EOL;
1971
    }
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 start_add_lock_table()
Loading history...
1972
1973
    public function end_add_lock_table()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::end_add_lock_table" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1974
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1975
        return "UNLOCK TABLES;".PHP_EOL;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal UNLOCK TABLES; 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...
1976
    }
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 end_add_lock_table()
Loading history...
1977
1978
    public function start_add_disable_keys()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::start_add_disable_keys" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1979
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1980
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
1981
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
1982
        return "/*!40000 ALTER TABLE `${args[0]}` DISABLE KEYS */;".
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1983
            PHP_EOL;
1984
    }
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 start_add_disable_keys()
Loading history...
1985
1986
    public function end_add_disable_keys()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::end_add_disable_keys" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1987
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1988
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
1989
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
1990
        return "/*!40000 ALTER TABLE `${args[0]}` ENABLE KEYS */;".
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1991
            PHP_EOL;
1992
    }
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 end_add_disable_keys()
Loading history...
1993
1994
    public function start_disable_autocommit()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::start_disable_autocommit" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1995
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1996
        return "SET autocommit=0;".PHP_EOL;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal SET autocommit=0; 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...
1997
    }
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 start_disable_autocommit()
Loading history...
1998
1999
    public function end_disable_autocommit()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::end_disable_autocommit" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
2000
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2001
        return "COMMIT;".PHP_EOL;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal COMMIT; 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...
2002
    }
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 end_disable_autocommit()
Loading history...
2003
2004
    public function add_drop_database()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::add_drop_database" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
2005
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2006
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
2007
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
2008
        return "/*!40000 DROP DATABASE IF EXISTS `${args[0]}`*/;".
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
2009
            PHP_EOL.PHP_EOL;
2010
    }
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 add_drop_database()
Loading history...
2011
2012
    public function add_drop_trigger()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::add_drop_trigger" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
2013
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2014
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
2015
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
2016
        return "DROP TRIGGER IF EXISTS `${args[0]}`;".PHP_EOL;
2017
    }
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 add_drop_trigger()
Loading history...
2018
2019
    public function drop_table()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::drop_table" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
2020
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2021
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
2022
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
2023
        return "DROP TABLE IF EXISTS `${args[0]}`;".PHP_EOL;
2024
    }
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 drop_table()
Loading history...
2025
2026
    public function drop_view()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::drop_view" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
2027
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2028
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
2029
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
2030
        return "DROP TABLE IF EXISTS `${args[0]}`;".PHP_EOL.
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
2031
                "/*!50001 DROP VIEW IF EXISTS `${args[0]}`*/;".PHP_EOL;
2032
    }
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 drop_view()
Loading history...
2033
2034
    public function getDatabaseHeader()
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
2035
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2036
        $this->check_parameters(func_num_args(), $expected_num_args = 1, __METHOD__);
0 ignored issues
show
Coding Style introduced by
Variable "expected_num_args" 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...
2037
        $args = func_get_args();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 55 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...
2038
        return "--".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal -- does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
2039
            "-- Current Database: `${args[0]}`".PHP_EOL.
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
2040
            "--".PHP_EOL.PHP_EOL;
0 ignored issues
show
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...
2041
    }
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 getDatabaseHeader()
Loading history...
2042
2043
    /**
2044
     * Decode column metadata and fill info structure.
2045
     * type, is_numeric and is_blob will always be available.
2046
     *
2047
     * @param array $colType Array returned from "SHOW COLUMNS FROM tableName"
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
2048
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
2049
     */
2050
    public function parseColumnType($colType)
0 ignored issues
show
introduced by
Type hint "array" missing for $colType
Loading history...
2051
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2052
        $colInfo = array();
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
Short array syntax must be used to define arrays
Loading history...
2053
        $colParts = explode(" ", $colType['Type']);
0 ignored issues
show
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...
2054
2055
        if ($fparen = strpos($colParts[0], "(")) {
0 ignored issues
show
Coding Style introduced by
Assignments must be the first block of code on a line
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...
2056
            $colInfo['type'] = substr($colParts[0], 0, $fparen);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 7 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...
2057
            $colInfo['length'] = str_replace(")", "", substr($colParts[0], $fparen + 1));
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 Comprehensibility introduced by
The string literal ) does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style Comprehensibility introduced by
The string literal does not require double quotes, as per coding-style, please use single quotes.

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

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

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

<?php

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

print $doubleQuoted;

will print an indented: Single is Value

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

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

Loading history...
Coding Style introduced by
Arithmetic operation must be bracketed
Loading history...
2058
            $colInfo['attributes'] = isset($colParts[1]) ? $colParts[1] : 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
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...
2059
        } else {
2060
            $colInfo['type'] = $colParts[0];
2061
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
2062
        $colInfo['is_numeric'] = in_array($colInfo['type'], $this->mysqlTypes['numerical']);
2063
        $colInfo['is_blob'] = in_array($colInfo['type'], $this->mysqlTypes['blob']);
0 ignored issues
show
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...
2064
        // for virtual columns that are of type 'Extra', column type
0 ignored issues
show
Coding Style Documentation introduced by
Inline comments must start with a capital letter
Loading history...
2065
        // could by "STORED GENERATED" or "VIRTUAL GENERATED"
2066
        // MySQL reference: https://dev.mysql.com/doc/refman/5.7/en/create-table-generated-columns.html
0 ignored issues
show
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...
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
2067
        $colInfo['is_virtual'] = strpos($colType['Extra'], "VIRTUAL GENERATED") !== false || strpos($colType['Extra'], "STORED GENERATED") !== false;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal VIRTUAL GENERATED 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
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
Boolean operators are not allowed outside of control structure conditions
Loading history...
Coding Style Comprehensibility introduced by
The string literal STORED GENERATED 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 149 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...
2068
2069
        return $colInfo;
2070
    }
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 parseColumnType()
Loading history...
2071
2072
    public function backup_parameters()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::backup_parameters" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
2073
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2074
        $ret = "/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET @OLD_CHARAC...HARACTER_SET_CLIENT */; 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
Concat operator must not be surrounded by spaces
Loading history...
2075
            "/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET @OLD_CHARAC...ARACTER_SET_RESULTS */; 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
Concat operator must not be surrounded by spaces
Loading history...
2076
            "/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET @OLD_COLLAT...OLLATION_CONNECTION */; 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
Concat operator must not be surrounded by spaces
Loading history...
2077
            "/*!40101 SET NAMES ".$this->dumpSettings['default-character-set']." */;".PHP_EOL;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET NAMES 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 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...
2078
2079
        if (false === $this->dumpSettings['skip-tz-utc']) {
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...
2080
            $ret .= "/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 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
Concat operator must not be surrounded by spaces
Loading history...
2081
                "/*!40103 SET TIME_ZONE='+00:00' */;".PHP_EOL;
2082
        }
2083
2084
        $ret .= "/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40014 SET @OLD_UNIQUE...KS, UNIQUE_CHECKS=0 */; 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
Concat operator must not be surrounded by spaces
Loading history...
2085
            "/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40014 SET @OLD_FOREIG...OREIGN_KEY_CHECKS=0 */; 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 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
Concat operator must not be surrounded by spaces
Loading history...
2086
            "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;".PHP_EOL.
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
2087
            "/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;".PHP_EOL.PHP_EOL;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40111 SET @OLD_SQL_NO..._NOTES, SQL_NOTES=0 */; 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...
2088
2089
        return $ret;
2090
    }
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 backup_parameters()
Loading history...
2091
2092
    public function restore_parameters()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::restore_parameters" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
2093
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2094
        $ret = "";
0 ignored issues
show
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...
2095
2096
        if (false === $this->dumpSettings['skip-tz-utc']) {
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...
2097
            $ret .= "/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;".PHP_EOL;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 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...
2098
        }
2099
2100
        $ret .= "/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 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
Concat operator must not be surrounded by spaces
Loading history...
2101
            "/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40014 SET FOREIGN_KEY..._FOREIGN_KEY_CHECKS */; 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
Concat operator must not be surrounded by spaces
Loading history...
2102
            "/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 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
Concat operator must not be surrounded by spaces
Loading history...
2103
            "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET CHARACTER_S...HARACTER_SET_CLIENT */; 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
Concat operator must not be surrounded by spaces
Loading history...
2104
            "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET CHARACTER_S...ARACTER_SET_RESULTS */; 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
Concat operator must not be surrounded by spaces
Loading history...
2105
            "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET COLLATION_C...OLLATION_CONNECTION */; 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
Concat operator must not be surrounded by spaces
Loading history...
2106
            "/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;".PHP_EOL.PHP_EOL;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 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...
2107
2108
        return $ret;
2109
    }
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 restore_parameters()
Loading history...
2110
2111
    /**
2112
     * Check number of parameters passed to function, useful when inheriting.
2113
     * Raise exception if unexpected.
2114
     *
2115
     * @param integer $num_args
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
2116
     * @param integer $expected_num_args
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
2117
     * @param string $method_name
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 2 spaces after parameter type; 1 found
Loading history...
2118
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
2119
    private function check_parameters($num_args, $expected_num_args, $method_name)
0 ignored issues
show
Coding Style introduced by
Private method name "TypeAdapterMysql::check_parameters" must be prefixed with an underscore
Loading history...
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection seeker becomes databaseConnectionSeeker.

Loading history...
Coding Style introduced by
Variable "num_args" is not in valid camel caps format
Loading history...
Coding Style introduced by
Variable "expected_num_args" is not in valid camel caps format
Loading history...
Coding Style introduced by
Variable "method_name" is not in valid camel caps format
Loading history...
2120
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2121
        if ($num_args != $expected_num_args) {
0 ignored issues
show
Coding Style introduced by
Variable "num_args" is not in valid camel caps format
Loading history...
Coding Style introduced by
Operator != prohibited; use !== instead
Loading history...
Coding Style introduced by
Variable "expected_num_args" is not in valid camel caps format
Loading history...
2122
            throw new Exception("Unexpected parameter passed to $method_name");
0 ignored issues
show
Coding Style introduced by
Variable "method_name" is not in valid camel caps format
Loading history...
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $method_name 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...
2123
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
2124
        return;
0 ignored issues
show
Coding Style introduced by
Empty return statement not required here
Loading history...
2125
    }
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 check_parameters()
Loading history...
2126
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
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...
2127