Completed
Push — master ( 0931ad...7533cf )
by diego
07:47 queued 05:18
created

Mysqldump   F

Complexity

Total Complexity 178

Size/Duplication

Total Lines 1295
Duplicated Lines 0 %

Importance

Changes 81
Bugs 15 Features 8
Metric Value
wmc 178
eloc 510
c 81
b 15
f 8
dl 0
loc 1295
rs 2

44 Methods

Rating   Name   Duplication   Size   Complexity  
A getFunctionStructure() 0 14 3
B parseDsn() 0 34 9
A prepareColumnValues() 0 18 4
A getTableColumnTypes() 0 20 2
A exportProcedures() 0 5 2
A getDatabaseStructureProcedures() 0 9 3
A setTransformTableRowHook() 0 3 1
A exportTriggers() 0 5 2
A getDatabaseStructureFunctions() 0 9 3
A exportEvents() 0 5 2
B connect() 0 40 8
A setTableLimits() 0 3 1
A getTriggerStructure() 0 13 3
A __destruct() 0 3 1
A getTableStructure() 0 25 5
A getProcedureStructure() 0 14 3
B __construct() 0 82 7
A exportFunctions() 0 5 2
A getEventStructure() 0 14 3
F listValues() 0 70 13
A exportViews() 0 16 6
A setInfoHook() 0 3 1
B escape() 0 15 7
A createStandInTable() 0 12 2
B start() 0 73 6
A matches() 0 14 5
A setTableWheres() 0 3 1
A getDatabaseStructureTriggers() 0 9 3
A getColumnNames() 0 12 3
A array_replace_recursive() 0 14 4
A getDumpFileFooter() 0 12 3
A getViewStructureView() 0 21 3
B prepareListValues() 0 39 8
A getTableLimit() 0 12 3
A getDatabaseStructureEvents() 0 9 3
A getDatabaseStructureTables() 0 22 5
B getColumnStmt() 0 17 7
A getDatabaseStructureViews() 0 22 5
A getDumpFileHeader() 0 19 4
A getViewStructureTable() 0 22 4
A setTransformColumnValueHook() 0 3 1
B endListValues() 0 39 8
A getTableWhere() 0 9 3
A exportTables() 0 15 6

How to fix   Complexity   

Complex Class

Complex classes like Mysqldump often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use Mysqldump, and based on these observations, apply Extract Interface, too.

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
 * Tags: mysql mysqldump pdo php7 php5 database php sql hhvm mariadb mysql-backup.
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
 * Class Mysqldump.
24
 *
25
 * @category Library
0 ignored issues
show
Coding Style Documentation introduced by
@category tag is not allowed in class comment
Loading history...
26
 * @author   Diego Torres <[email protected]>
0 ignored issues
show
Coding Style Documentation introduced by
@author tag is not allowed in class comment
Loading history...
27
 * @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...
28
 * @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...
29
 *
30
 */
0 ignored issues
show
Coding Style introduced by
Additional blank lines found at end of doc comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
31
class Mysqldump
32
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class Mysqldump
Loading history...
33
34
    // Same as mysqldump.
35
    const MAXLINESIZE = 1000000;
36
37
    // List of available compression methods as constants.
38
    const GZIP  = 'Gzip';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 2 spaces

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...
39
    const BZIP2 = 'Bzip2';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space

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

To visualize

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

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

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

will produce no issues.

Loading history...
40
    const NONE  = 'None';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 2 spaces

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...
41
    const GZIPSTREAM = 'Gzipstream';
42
43
    // List of available connection strings.
44
    const UTF8    = 'utf8';
45
    const UTF8MB4 = 'utf8mb4';
46
47
    /**
48
     * Database username.
49
     * @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...
50
     */
51
    public $user;
52
53
    /**
54
     * Database password.
55
     * @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...
56
     */
57
    public $pass;
58
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;
64
65
    /**
66
     * Destination filename, defaults to stdout.
67
     * @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...
68
     */
69
    public $fileName = 'php://stdout';
70
71
    // Internal stuff.
72
    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...
73
    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...
74
    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...
75
    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...
76
    private $functions = array();
0 ignored issues
show
Coding Style introduced by
Private member variable "functions" 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 "functions" 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...
77
    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...
78
    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...
79
    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...
80
    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...
81
    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...
82
    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...
83
    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...
84
    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...
85
    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...
86
    private $transformTableRowCallable;
0 ignored issues
show
Coding Style introduced by
Private member variable "transformTableRowCallable" 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 "transformTableRowCallable" must be prefixed with an underscore
Loading history...
87
    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...
88
    private $infoCallable;
0 ignored issues
show
Coding Style introduced by
Private member variable "infoCallable" 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 "infoCallable" must be prefixed with an underscore
Loading history...
89
90
    /**
91
     * Database name, parsed from dsn.
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 $dbName;
0 ignored issues
show
Coding Style introduced by
Private member variable "dbName" must contain a leading underscore
Loading history...
Coding Style introduced by
Private member variable "dbName" must be prefixed with an underscore
Loading history...
95
96
    /**
97
     * Host name, parsed from dsn.
98
     * @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...
99
     */
100
    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
Private member variable "host" must be prefixed with an underscore
Loading history...
101
102
    /**
103
     * Dsn string parsed as an array.
104
     * @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...
105
     */
106
    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
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...
107
108
    /**
109
     * Keyed on table name, with the value as the conditions.
110
     * e.g. - 'users' => 'date_registered > NOW() - INTERVAL 6 MONTH'
111
     *
112
     * @var array
113
     */
114
    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...
115
    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...
116
117
118
    /**
119
     * Constructor of Mysqldump. Note that in the case of an SQLite database
120
     * connection, the filename must be in the $db parameter.
121
     *
122
     * @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...
123
     * @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...
124
     * @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...
125
     * @param array  $dumpSettings SQL database settings
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
126
     * @param array  $pdoSettings  PDO configured attributes
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
127
     */
0 ignored issues
show
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
128
    public function __construct(
0 ignored issues
show
introduced by
Type hint "array" missing for $dumpSettings
Loading history...
introduced by
Type hint "array" missing for $pdoSettings
Loading history...
129
        $dsn = '',
130
        $user = '',
131
        $pass = '',
132
        $dumpSettings = array(),
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
133
        $pdoSettings = array()
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
134
    ) {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on a new line
Loading history...
135
        $dumpSettingsDefault = array(
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
136
            '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...
137
            '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...
138
            'include-views' => 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...
139
            '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...
140
            '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...
141
            '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...
142
            '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...
143
            '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...
144
            '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...
145
            '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...
146
            '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...
147
            '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...
148
            '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...
149
            '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...
150
            '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...
151
            '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...
152
            '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...
153
            '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...
154
            '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...
155
            '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...
156
            '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...
157
            '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...
158
            '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...
159
            '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...
160
            '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...
161
            '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...
162
            '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...
163
            '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...
164
            '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...
165
            '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...
166
            '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...
167
            /* deprecated */
0 ignored issues
show
Coding Style introduced by
Single line block comment not allowed; use inline ("// text") comment instead
Loading history...
168
            '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...
169
        );
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...
170
171
        $pdoSettingsDefault = array(
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
172
            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...
173
            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...
174
        );
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...
175
176
        $this->user = $user;
177
        $this->pass = $pass;
178
        $this->parseDsn($dsn);
179
180
        // This drops MYSQL dependency, only use the constant if it's defined.
181
        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...
182
            $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...
183
        }
184
185
        $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...
186
        $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...
187
        $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...
188
189
        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...
190
            $this->dumpSettings['init_commands'][] = "SET TIME_ZONE='+00:00'";
191
        }
192
193
        $diff = array_diff(array_keys($this->dumpSettings), array_keys($dumpSettingsDefault));
194
        if (count($diff) > 0) {
195
            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...
196
        }
197
198
        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...
199
            !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...
200
            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...
201
        }
202
203
        // If no include-views is passed in, dump the same views as tables, mimic mysqldump behaviour.
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...
204
        if ( ! isset( $dumpSettings['include-views'] ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
First condition of a multi-line IF statement must directly follow the opening parenthesis
Loading history...
205
			$this->dumpSettings['include-views'] = $this->dumpSettings['include-tables'];
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 12 spaces, found 3
Loading history...
206
        }
207
208
        // 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...
209
        $this->compressManager = CompressManagerFactory::create($this->dumpSettings['compress']);
210
    }
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...
211
212
    /**
213
     * Destructor of Mysqldump. Unsets dbHandlers and database objects.
214
     */
215
    public function __destruct()
216
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
217
        $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...
218
    }
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...
219
220
    /**
221
     * Custom array_replace_recursive to be used if PHP < 5.3
222
     * Replaces elements from passed arrays into the first array recursively.
223
     *
224
     * @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...
225
     * @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...
226
     *
227
     * @return array Returns an array, or NULL if an error occurs.
228
     */
229
    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...
230
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
231
        if (function_exists('array_replace_recursive')) {
232
            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...
233
        }
234
235
        foreach ($array2 as $key => $value) {
0 ignored issues
show
Coding Style introduced by
Variable "array2" contains numbers but this is discouraged
Loading history...
236
            if (is_array($value)) {
237
                $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...
238
            } else {
239
                $array1[$key] = $value;
0 ignored issues
show
Coding Style introduced by
Variable "array1" contains numbers but this is discouraged
Loading history...
240
            }
241
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
242
        return $array1;
0 ignored issues
show
Coding Style introduced by
Variable "array1" contains numbers but this is discouraged
Loading history...
243
    }
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...
244
245
    /**
246
     * Keyed by table name, with the value as the conditions:
247
     * e.g. 'users' => 'date_registered > NOW() - INTERVAL 6 MONTH AND deleted=0'
248
     *
249
     * @param array $tableWheres
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
250
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
251
    public function setTableWheres(array $tableWheres)
252
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
253
        $this->tableWheres = $tableWheres;
254
    }
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...
255
256
    /**
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...
257
     * @param $tableName
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter name
Loading history...
258
     *
259
     * @return boolean|mixed
260
     */
261
    public function getTableWhere($tableName)
0 ignored issues
show
introduced by
Type hint "tableName" missing for
Loading history...
262
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
263
        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...
264
            return $this->tableWheres[$tableName];
265
        } elseif ($this->dumpSettings['where']) {
0 ignored issues
show
Coding Style introduced by
Usage of ELSEIF not allowed; use ELSE IF instead
Loading history...
266
            return $this->dumpSettings['where'];
267
        }
268
269
        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...
270
    }
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...
271
272
    /**
273
     * Keyed by table name, with the value as the numeric limit:
274
     * e.g. 'users' => 3000
275
     *
276
     * @param array $tableLimits
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
277
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
278
    public function setTableLimits(array $tableLimits)
279
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
280
        $this->tableLimits = $tableLimits;
281
    }
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...
282
283
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $tableName should have a doc-comment as per coding-style.
Loading history...
284
     * Returns the LIMIT for the table.  Must be numeric to be returned.
285
     * @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...
286
     * @return boolean
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
287
     */
288
    public function getTableLimit($tableName)
0 ignored issues
show
introduced by
Type hint "tableName" missing for
Loading history...
289
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
290
        if (empty($this->tableLimits[$tableName])) {
291
            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...
292
        }
293
294
        $limit = $this->tableLimits[$tableName];
295
        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...
296
            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...
297
        }
298
299
        return $limit;
300
    }
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...
301
302
    /**
303
     * Parse DSN string and extract dbname value
304
     * Several examples of a DSN string
305
     *   mysql:host=localhost;dbname=testdb
306
     *   mysql:host=localhost;port=3307;dbname=testdb
307
     *   mysql:unix_socket=/tmp/mysql.sock;dbname=testdb
308
     *
309
     * @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...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
310
     * @return boolean
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
311
     */
0 ignored issues
show
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
312
    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...
313
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
314
        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...
315
            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...
316
        }
317
318
        $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...
319
        $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...
320
321
        if (empty($this->dbType)) {
322
            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...
323
        }
324
325
        $dsn = substr($dsn, $pos + 1);
0 ignored issues
show
Coding Style introduced by
Arithmetic operation must be bracketed
Loading history...
326
327
        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...
328
            $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...
329
            $this->dsnArray[strtolower($kvpArr[0])] = $kvpArr[1];
330
        }
331
332
        if (empty($this->dsnArray['host']) &&
333
            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...
334
            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...
335
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
336
        $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...
337
            $this->dsnArray['host'] : $this->dsnArray['unix_socket'];
338
339
        if (empty($this->dsnArray['dbname'])) {
340
            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...
341
        }
342
343
        $this->dbName = $this->dsnArray['dbname'];
344
345
        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...
346
    }
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...
347
348
    /**
349
     * Connect with PDO.
350
     *
351
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
352
     */
0 ignored issues
show
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
353
    private function connect()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::connect" must be prefixed with an underscore
Loading history...
354
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
355
        // Connecting with PDO.
356
        try {
357
            switch ($this->dbType) {
358
                case 'sqlite':
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
359
                    $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...
360
                    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...
361
                case 'mysql':
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
362
                case 'pgsql':
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
363
                case 'dblib':
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
364
                    $this->dbHandler = @new PDO(
0 ignored issues
show
Coding Style introduced by
Silencing errors is discouraged
Loading history...
365
                        $this->dsn,
366
                        $this->user,
367
                        $this->pass,
368
                        $this->pdoSettings
369
                    );
370
                    // 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...
371
                    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...
372
                        $this->dbHandler->exec($stmt);
373
                    }
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...
374
                    // 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...
375
                    $this->version = $this->dbHandler->getAttribute(PDO::ATTR_SERVER_VERSION);
376
                    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...
377
                default:
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 12 spaces, found 16
Loading history...
378
                    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

378
                    throw new Exception("Unsupported database type ("./** @scrutinizer ignore-type */ $this->dbType.")");
Loading history...
379
            }
0 ignored issues
show
Coding Style introduced by
End comment for long condition not found; expected "//end switch"
Loading history...
380
        } catch (PDOException $e) {
381
            throw new Exception(
382
                "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...
383
                $e->getMessage()
384
            );
385
        }
0 ignored issues
show
Coding Style introduced by
End comment for long condition not found; expected "//end try"
Loading history...
386
387
        if (is_null($this->dbHandler)) {
388
            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...
389
        }
390
391
        $this->dbHandler->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_NATURAL);
392
        $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...
393
    }
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...
394
395
    /**
396
     * Primary function, triggers dumping.
397
     *
398
     * @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...
399
     * @return null
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
400
     * @throws \Exception
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
introduced by
Comment missing for @throws tag in function comment
Loading history...
401
     */
0 ignored issues
show
Coding Style Documentation introduced by
Missing @throws tag for "Exception" exception
Loading history...
402
    public function start($filename = '')
403
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
404
        // 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...
405
        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...
406
            $this->fileName = $filename;
407
        }
408
409
        // 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...
410
        $this->connect();
411
412
        // 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...
413
        $this->compressManager->open($this->fileName);
414
415
        // 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...
416
        $this->compressManager->write($this->getDumpFileHeader());
417
418
        // 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...
419
        $this->compressManager->write(
420
            $this->typeAdapter->backup_parameters()
421
        );
422
423
        if ($this->dumpSettings['databases']) {
424
            $this->compressManager->write(
425
                $this->typeAdapter->getDatabaseHeader($this->dbName)
426
            );
427
            if ($this->dumpSettings['add-drop-database']) {
428
                $this->compressManager->write(
429
                    $this->typeAdapter->add_drop_database($this->dbName)
430
                );
431
            }
432
        }
433
434
        // Get table, view, trigger, procedures, functions and events structures from
435
        // database.
436
        $this->getDatabaseStructureTables();
437
        $this->getDatabaseStructureViews();
438
        $this->getDatabaseStructureTriggers();
439
        $this->getDatabaseStructureProcedures();
440
        $this->getDatabaseStructureFunctions();
441
        $this->getDatabaseStructureEvents();
442
443
        if ($this->dumpSettings['databases']) {
444
            $this->compressManager->write(
445
                $this->typeAdapter->databases($this->dbName)
446
            );
447
        }
448
449
        // If there still are some tables/views in include-tables array,
450
        // that means that some tables or views weren't found.
451
        // Give proper error and exit.
452
        // This check will be removed once include-tables supports regexps.
453
        if (0 < count($this->dumpSettings['include-tables'])) {
454
            $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...
455
            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...
456
        }
457
458
        $this->exportTables();
459
        $this->exportTriggers();
460
        $this->exportFunctions();
461
        $this->exportProcedures();
462
        $this->exportViews();
463
        $this->exportEvents();
464
465
        // Restore saved parameters.
466
        $this->compressManager->write(
467
            $this->typeAdapter->restore_parameters()
468
        );
469
        // Write some stats to output file.
470
        $this->compressManager->write($this->getDumpFileFooter());
471
        // Close output file.
472
        $this->compressManager->close();
473
474
        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...
475
    }
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...
476
477
    /**
478
     * Returns header for dump file.
479
     *
480
     * @return string
481
     */
482
    private function getDumpFileHeader()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDumpFileHeader" must be prefixed with an underscore
Loading history...
483
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
484
        $header = '';
485
        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...
486
            // 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...
487
            $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...
488
                    "--".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...
489
                    "-- 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...
490
                    "-- ------------------------------------------------------".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...
491
492
            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...
493
                $header .= "-- Server version \t".$this->version.PHP_EOL;
494
            }
495
496
            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...
497
                $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...
498
            }
499
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
500
        return $header;
501
    }
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...
502
503
    /**
504
     * Returns footer for dump file.
505
     *
506
     * @return string
507
     */
508
    private function getDumpFileFooter()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDumpFileFooter" must be prefixed with an underscore
Loading history...
509
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
510
        $footer = '';
511
        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...
512
            $footer .= '-- Dump completed';
513
            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...
514
                $footer .= ' on: '.date('r');
515
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
516
            $footer .= PHP_EOL;
517
        }
518
519
        return $footer;
520
    }
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...
521
522
    /**
523
     * Reads table names from database.
524
     * Fills $this->tables array so they will be dumped later.
525
     *
526
     * @return null
527
     */
528
    private function getDatabaseStructureTables()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDatabaseStructureTables" must be prefixed with an underscore
Loading history...
529
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
530
        // 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...
531
        if (empty($this->dumpSettings['include-tables'])) {
532
            // 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...
533
            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...
534
                array_push($this->tables, current($row));
535
            }
536
        } else {
537
            // 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...
538
            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...
539
                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...
540
                    array_push($this->tables, current($row));
541
                    $elem = array_search(
542
                        current($row),
543
                        $this->dumpSettings['include-tables']
544
                    );
545
                    unset($this->dumpSettings['include-tables'][$elem]);
546
                }
547
            }
548
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
549
        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...
550
    }
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...
551
552
    /**
553
     * Reads view names from database.
554
     * Fills $this->tables array so they will be dumped later.
555
     *
556
     * @return null
557
     */
558
    private function getDatabaseStructureViews()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDatabaseStructureViews" must be prefixed with an underscore
Loading history...
559
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
560
        // 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...
561
        if (empty($this->dumpSettings['include-views'])) {
562
            // 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...
563
            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...
564
                array_push($this->views, current($row));
565
            }
566
        } else {
567
            // 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...
568
            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...
569
                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...
570
                    array_push($this->views, current($row));
571
                    $elem = array_search(
572
                        current($row),
573
                        $this->dumpSettings['include-views']
574
                    );
575
                    unset($this->dumpSettings['include-views'][$elem]);
576
                }
577
            }
578
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
579
        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...
580
    }
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...
581
582
    /**
583
     * Reads trigger names from database.
584
     * Fills $this->tables array so they will be dumped later.
585
     *
586
     * @return null
587
     */
588
    private function getDatabaseStructureTriggers()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDatabaseStructureTriggers" must be prefixed with an underscore
Loading history...
589
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
590
        // 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...
591
        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...
592
            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...
593
                array_push($this->triggers, $row['Trigger']);
594
            }
595
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
596
        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...
597
    }
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...
598
599
    /**
600
     * Reads procedure names from database.
601
     * Fills $this->tables array so they will be dumped later.
602
     *
603
     * @return null
604
     */
605
    private function getDatabaseStructureProcedures()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDatabaseStructureProcedures" must be prefixed with an underscore
Loading history...
606
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
607
        // 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...
608
        if ($this->dumpSettings['routines']) {
609
            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...
610
                array_push($this->procedures, $row['procedure_name']);
611
            }
612
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
613
        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...
614
    }
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...
615
616
    /**
617
     * Reads functions names from database.
618
     * Fills $this->tables array so they will be dumped later.
619
     *
620
     * @return null
621
     */
622
    private function getDatabaseStructureFunctions()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDatabaseStructureFunctions" must be prefixed with an underscore
Loading history...
623
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
624
        // Listing all functions from database
0 ignored issues
show
Coding Style introduced by
Inline comments must end in full-stops, exclamation marks, or question marks
Loading history...
625
        if ($this->dumpSettings['routines']) {
626
            foreach ($this->dbHandler->query($this->typeAdapter->show_functions($this->dbName)) as $row) {
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 106 characters

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

Loading history...
627
                array_push($this->functions, $row['function_name']);
628
            }
629
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
630
        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...
631
    }
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 getDatabaseStructureFunctions()
Loading history...
632
633
    /**
634
     * Reads event names from database.
635
     * Fills $this->tables array so they will be dumped later.
636
     *
637
     * @return null
638
     */
639
    private function getDatabaseStructureEvents()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getDatabaseStructureEvents" must be prefixed with an underscore
Loading history...
640
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
641
        // 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...
642
        if ($this->dumpSettings['events']) {
643
            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...
644
                array_push($this->events, $row['event_name']);
645
            }
646
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
647
        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...
648
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end getDatabaseStructureEvents()
Loading history...
649
650
    /**
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...
651
     * Compare if $table name matches with a definition inside $arr
652
     * @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...
653
     * @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...
654
     * @return boolean
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
655
     */
656
    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...
657
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
658
        $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...
659
660
        foreach ($arr as $pattern) {
661
            if ('/' != $pattern[0]) {
0 ignored issues
show
Coding Style introduced by
Operator != prohibited; use !== instead
Loading history...
662
                continue;
663
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
664
            if (1 == preg_match($pattern, $table)) {
0 ignored issues
show
Coding Style introduced by
Operator == prohibited; use === instead
Loading history...
665
                $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...
666
            }
667
        }
668
669
        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...
670
    }
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...
671
672
    /**
673
     * Exports all the tables selected from database
674
     *
675
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
676
     */
677
    private function exportTables()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::exportTables" must be prefixed with an underscore
Loading history...
678
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
679
        // 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...
680
        foreach ($this->tables as $table) {
681
            if ($this->matches($table, $this->dumpSettings['exclude-tables'])) {
682
                continue;
683
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
684
            $this->getTableStructure($table);
685
            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...
686
                $this->listValues($table);
687
            } 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...
688
                 || $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...
689
                continue;
690
            } else {
691
                $this->listValues($table);
692
            }
693
        }
694
    }
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...
695
696
    /**
697
     * Exports all the views found in database
698
     *
699
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
700
     */
701
    private function exportViews()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::exportViews" must be prefixed with an underscore
Loading history...
702
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
703
        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...
704
            // 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...
705
            foreach ($this->views as $view) {
706
                if ($this->matches($view, $this->dumpSettings['exclude-tables'])) {
707
                    continue;
708
                }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
709
                $this->tableColumnTypes[$view] = $this->getTableColumnTypes($view);
710
                $this->getViewStructureTable($view);
711
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
712
            foreach ($this->views as $view) {
713
                if ($this->matches($view, $this->dumpSettings['exclude-tables'])) {
714
                    continue;
715
                }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
716
                $this->getViewStructureView($view);
717
            }
718
        }
719
    }
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...
720
721
    /**
722
     * Exports all the triggers found in database
723
     *
724
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
725
     */
726
    private function exportTriggers()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::exportTriggers" must be prefixed with an underscore
Loading history...
727
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
728
        // 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...
729
        foreach ($this->triggers as $trigger) {
730
            $this->getTriggerStructure($trigger);
731
        }
732
733
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected //end exportTriggers()
Loading history...
Coding Style introduced by
Function closing brace must go on the next line following the body; found 1 blank lines before brace
Loading history...
734
735
    /**
736
     * Exports all the procedures found in database
737
     *
738
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
739
     */
740
    private function exportProcedures()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::exportProcedures" must be prefixed with an underscore
Loading history...
741
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
742
        // 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...
743
        foreach ($this->procedures as $procedure) {
744
            $this->getProcedureStructure($procedure);
745
        }
746
    }
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...
747
748
    /**
749
     * Exports all the functions found in database
750
     *
751
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
752
     */
753
    private function exportFunctions()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::exportFunctions" must be prefixed with an underscore
Loading history...
754
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
755
        // 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...
756
        foreach ($this->functions as $function) {
757
            $this->getFunctionStructure($function);
758
        }
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 exportFunctions()
Loading history...
760
761
    /**
762
     * Exports all the events found in database
763
     *
764
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
765
     */
766
    private function exportEvents()
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::exportEvents" must be prefixed with an underscore
Loading history...
767
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
768
        // 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...
769
        foreach ($this->events as $event) {
770
            $this->getEventStructure($event);
771
        }
772
    }
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...
773
774
    /**
775
     * Table structure extractor
776
     *
777
     * @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...
778
     * @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...
779
     * @return null
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
780
     */
781
    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...
782
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
783
        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...
784
            $ret = '';
785
            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...
786
                $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...
787
                    "-- 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...
788
                    "--".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...
789
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
790
            $stmt = $this->typeAdapter->show_create_table($tableName);
791
            foreach ($this->dbHandler->query($stmt) as $r) {
792
                $this->compressManager->write($ret);
793
                if ($this->dumpSettings['add-drop-table']) {
794
                    $this->compressManager->write(
795
                        $this->typeAdapter->drop_table($tableName)
796
                    );
797
                }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
798
                $this->compressManager->write(
799
                    $this->typeAdapter->create_table($r)
800
                );
801
                break;
802
            }
803
        }
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...
804
        $this->tableColumnTypes[$tableName] = $this->getTableColumnTypes($tableName);
805
        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...
806
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end getTableStructure()
Loading history...
807
808
    /**
809
     * Store column types to create data dumps and for Stand-In tables
810
     *
811
     * @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...
812
     * @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...
813
     */
0 ignored issues
show
Coding Style introduced by
There must be no blank lines after the function comment
Loading history...
814
815
    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...
816
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
817
        $columnTypes = array();
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
818
        $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...
819
            $this->typeAdapter->show_columns($tableName)
820
        );
821
        $columns->setFetchMode(PDO::FETCH_ASSOC);
822
823
        foreach ($columns as $key => $col) {
824
            $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...
825
            $columnTypes[$col['Field']] = array(
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
826
                '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...
827
                '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...
828
                '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...
829
                '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...
830
                '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...
831
            );
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...
832
        }
833
834
        return $columnTypes;
835
    }
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...
836
837
    /**
838
     * View structure extractor, create table (avoids cyclic references)
839
     *
840
     * @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...
841
     * @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...
842
     * @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...
843
     */
844
    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...
845
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
846
        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...
847
            $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...
848
                "-- 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...
849
                "--".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...
850
            $this->compressManager->write($ret);
851
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
852
        $stmt = $this->typeAdapter->show_create_view($viewName);
853
854
        // 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...
855
        foreach ($this->dbHandler->query($stmt) as $r) {
856
            if ($this->dumpSettings['add-drop-table']) {
857
                $this->compressManager->write(
858
                    $this->typeAdapter->drop_view($viewName)
859
                );
860
            }
861
862
            $this->compressManager->write(
863
                $this->createStandInTable($viewName)
864
            );
865
            break;
866
        }
867
    }
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...
868
869
    /**
870
     * Write a create table statement for the table Stand-In, show create
871
     * table would return a create algorithm when used on a view
872
     *
873
     * @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...
874
     * @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...
875
     */
876
    public function createStandInTable($viewName)
877
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
878
        $ret = array();
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
879
        foreach ($this->tableColumnTypes[$viewName] as $k => $v) {
880
            $ret[] = "`${k}` ${v['type_sql']}";
881
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
882
        $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...
883
884
        $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...
885
            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...
886
887
        return $ret;
888
    }
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...
889
890
    /**
891
     * View structure extractor, create view
892
     *
893
     * @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...
894
     * @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...
895
     * @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...
896
     */
897
    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...
898
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
899
        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...
900
            $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...
901
                "-- 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...
902
                "--".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...
903
            $this->compressManager->write($ret);
904
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
905
        $stmt = $this->typeAdapter->show_create_view($viewName);
906
907
        // create views, to resolve dependencies
0 ignored issues
show
Coding Style Documentation introduced by
Inline comments must start with a capital letter
Loading history...
908
        // 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...
909
        foreach ($this->dbHandler->query($stmt) as $r) {
910
            // 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...
911
            $this->compressManager->write(
912
                $this->typeAdapter->drop_view($viewName)
913
            );
914
            $this->compressManager->write(
915
                $this->typeAdapter->create_view($r)
916
            );
917
            break;
918
        }
919
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end getViewStructureView()
Loading history...
920
921
    /**
922
     * Trigger structure extractor
923
     *
924
     * @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...
925
     * @return null
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
926
     */
927
    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...
928
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
929
        $stmt = $this->typeAdapter->show_create_trigger($triggerName);
930
        foreach ($this->dbHandler->query($stmt) as $r) {
931
            if ($this->dumpSettings['add-drop-trigger']) {
932
                $this->compressManager->write(
933
                    $this->typeAdapter->add_drop_trigger($triggerName)
934
                );
935
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
936
            $this->compressManager->write(
937
                $this->typeAdapter->create_trigger($r)
938
            );
939
            return;
0 ignored issues
show
introduced by
Function return type is not void, but function is returning void here
Loading history...
940
        }
941
    }
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...
942
943
    /**
944
     * Procedure structure extractor
945
     *
946
     * @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...
947
     * @return null
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
948
     */
949
    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...
950
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
951
        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...
952
            $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...
953
                "-- 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...
954
                "--".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...
955
            $this->compressManager->write($ret);
956
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
957
        $stmt = $this->typeAdapter->show_create_procedure($procedureName);
958
        foreach ($this->dbHandler->query($stmt) as $r) {
959
            $this->compressManager->write(
960
                $this->typeAdapter->create_procedure($r)
961
            );
962
            return;
0 ignored issues
show
introduced by
Function return type is not void, but function is returning void here
Loading history...
963
        }
964
    }
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...
965
966
    /**
967
     * Function structure extractor
968
     *
969
     * @param string $functionName  Name of function 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...
970
     * @return null
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
971
     */
972
    private function getFunctionStructure($functionName)
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::getFunctionStructure" must be prefixed with an underscore
Loading history...
973
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
974
        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...
975
            $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...
976
                "-- 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...
977
                "--".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...
978
            $this->compressManager->write($ret);
979
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
980
        $stmt = $this->typeAdapter->show_create_function($functionName);
981
        foreach ($this->dbHandler->query($stmt) as $r) {
982
            $this->compressManager->write(
983
                $this->typeAdapter->create_function($r)
984
            );
985
            return;
0 ignored issues
show
introduced by
Function return type is not void, but function is returning void here
Loading history...
986
        }
987
    }
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 getFunctionStructure()
Loading history...
988
989
    /**
990
     * Event structure extractor
991
     *
992
     * @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...
993
     * @return null
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
994
     */
995
    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...
996
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
997
        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...
998
            $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...
999
                "-- 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...
1000
                "--".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...
1001
            $this->compressManager->write($ret);
1002
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1003
        $stmt = $this->typeAdapter->show_create_event($eventName);
1004
        foreach ($this->dbHandler->query($stmt) as $r) {
1005
            $this->compressManager->write(
1006
                $this->typeAdapter->create_event($r)
1007
            );
1008
            return;
0 ignored issues
show
introduced by
Function return type is not void, but function is returning void here
Loading history...
1009
        }
1010
    }
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...
1011
1012
    /**
1013
     * Prepare values for output
1014
     *
1015
     * @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...
1016
     * @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...
1017
     *   quoted
0 ignored issues
show
Coding Style introduced by
Parameter comment not aligned correctly; expected 19 spaces but found 3
Loading history...
1018
     *
1019
     * @return array
1020
     */
1021
    private function prepareColumnValues($tableName, array $row)
0 ignored issues
show
Coding Style introduced by
Private method name "Mysqldump::prepareColumnValues" must be prefixed with an underscore
Loading history...
1022
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1023
        $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...
1024
        $columnTypes = $this->tableColumnTypes[$tableName];
1025
1026
        if ($this->transformTableRowCallable) {
1027
            $row = call_user_func($this->transformTableRowCallable, $tableName, $row);
1028
        }
1029
1030
        foreach ($row as $colName => $colValue) {
1031
            if ($this->transformColumnValueCallable) {
1032
                $colValue = call_user_func($this->transformColumnValueCallable, $tableName, $colName, $colValue, $row);
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 119 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...
1033
            }
1034
1035
            $ret[] = $this->escape($colValue, $columnTypes[$colName]);
1036
        }
1037
1038
        return $ret;
1039
    }
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...
1040
1041
    /**
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...
1042
     * Escape values with quotes when needed
1043
     *
1044
     * @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...
1045
     * @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...
1046
     *
1047
     * @return string
1048
     */
1049
    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...
1050
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1051
        if (is_null($colValue)) {
1052
            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...
1053
        } 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...
1054
            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...
1055
                return "0x${colValue}";
1056
            } else {
1057
                return "''";
1058
            }
1059
        } elseif ($colType['is_numeric']) {
0 ignored issues
show
Coding Style introduced by
Usage of ELSEIF not allowed; use ELSE IF instead
Loading history...
1060
            return $colValue;
1061
        }
1062
1063
        return $this->dbHandler->quote($colValue);
1064
    }
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...
1065
1066
    /**
1067
     * Set a callable that will be used to transform table rows
1068
     *
1069
     * @param callable $callable
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1070
     *
1071
     * @return void
1072
     */
1073
    public function setTransformTableRowHook($callable)
0 ignored issues
show
introduced by
Type hint "callable" missing for $callable
Loading history...
1074
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1075
        $this->transformTableRowCallable = $callable;
1076
    }
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 setTransformTableRowHook()
Loading history...
1077
1078
    /**
1079
     * Set a callable that will be used to transform column values
1080
     *
1081
     * @param callable $callable
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1082
     *
1083
     * @return void
1084
     *
1085
     * @deprecated Use setTransformTableRowHook instead for better performance
1086
     */
1087
    public function setTransformColumnValueHook($callable)
0 ignored issues
show
introduced by
Type hint "callable" missing for $callable
Loading history...
1088
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1089
        $this->transformColumnValueCallable = $callable;
1090
    }
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...
1091
1092
    /**
1093
     * Set a callable that will be used to report dump information
1094
     *
1095
     * @param callable $callable
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1096
     *
1097
     * @return void
1098
     */
1099
    public function setInfoHook($callable)
0 ignored issues
show
introduced by
Type hint "callable" missing for $callable
Loading history...
1100
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1101
        $this->infoCallable = $callable;
1102
    }
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 setInfoHook()
Loading history...
1103
1104
    /**
1105
     * Table rows extractor
1106
     *
1107
     * @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...
1108
     *
1109
     * @return null
0 ignored issues
show
introduced by
Function return type is not void, but function has no return statement
Loading history...
1110
     */
1111
    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...
1112
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1113
        $this->prepareListValues($tableName);
1114
1115
        $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...
1116
        $lineSize = 0;
1117
1118
        // 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...
1119
        $colStmt = $this->getColumnStmt($tableName);
1120
        // 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...
1121
        if ($this->dumpSettings['complete-insert']) {
1122
            $colNames = $this->getColumnNames($tableName);
1123
        }
1124
1125
        $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...
1126
1127
        // 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...
1128
        $condition = $this->getTableWhere($tableName);
1129
1130
        if ($condition) {
1131
            $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...
1132
        }
1133
1134
        $limit = $this->getTableLimit($tableName);
1135
1136
        if ($limit) {
1137
            $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...
1138
        }
1139
1140
        $resultSet = $this->dbHandler->query($stmt);
1141
        $resultSet->setFetchMode(PDO::FETCH_ASSOC);
1142
1143
        $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...
1144
1145
        $count = 0;
1146
        foreach ($resultSet as $row) {
1147
            $count++;
1148
            $vals = $this->prepareColumnValues($tableName, $row);
1149
            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...
1150
                if ($this->dumpSettings['complete-insert']) {
1151
                    $lineSize += $this->compressManager->write(
1152
                        "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...
1153
                        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...
1154
                        ") 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...
1155
                    );
1156
                } else {
1157
                    $lineSize += $this->compressManager->write(
1158
                        "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...
1159
                    );
1160
                }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1161
                $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...
1162
            } else {
1163
                $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...
1164
            }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1165
            if (($lineSize > $this->dumpSettings['net_buffer_length']) ||
1166
                    !$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...
1167
                $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...
1168
                $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...
1169
            }
1170
        }
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...
1171
        $resultSet->closeCursor();
1172
1173
        if (!$onlyOnce) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1174
            $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...
1175
        }
1176
1177
        $this->endListValues($tableName, $count);
1178
1179
        if ($this->infoCallable) {
1180
            call_user_func($this->infoCallable, 'table', array('name' => $tableName, 'rowCount' => $count));
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
Coding Style introduced by
This line exceeds maximum limit of 100 characters; contains 108 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...
1181
        }
1182
    }
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...
1183
1184
    /**
1185
     * Table rows extractor, append information prior to dump
1186
     *
1187
     * @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...
1188
     *
1189
     * @return null
1190
     */
1191
    public function prepareListValues($tableName)
1192
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1193
        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...
1194
            $this->compressManager->write(
1195
                "--".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...
1196
                "-- 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...
1197
                "--".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...
1198
            );
1199
        }
1200
1201
        if ($this->dumpSettings['single-transaction']) {
1202
            $this->dbHandler->exec($this->typeAdapter->setup_transaction());
1203
            $this->dbHandler->exec($this->typeAdapter->start_transaction());
1204
        }
1205
1206
        if ($this->dumpSettings['lock-tables'] && !$this->dumpSettings['single-transaction']) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1207
            $this->typeAdapter->lock_table($tableName);
1208
        }
1209
1210
        if ($this->dumpSettings['add-locks']) {
1211
            $this->compressManager->write(
1212
                $this->typeAdapter->start_add_lock_table($tableName)
1213
            );
1214
        }
1215
1216
        if ($this->dumpSettings['disable-keys']) {
1217
            $this->compressManager->write(
1218
                $this->typeAdapter->start_add_disable_keys($tableName)
1219
            );
1220
        }
1221
1222
        // 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...
1223
        if ($this->dumpSettings['no-autocommit']) {
1224
            $this->compressManager->write(
1225
                $this->typeAdapter->start_disable_autocommit()
1226
            );
1227
        }
1228
1229
        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...
1230
    }
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...
1231
1232
    /**
1233
     * Table rows extractor, close locks and commits after dump
1234
     *
1235
     * @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...
1236
     * @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...
1237
     *
1238
     * @return void
1239
     */
1240
    public function endListValues($tableName, $count = 0)
1241
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1242
        if ($this->dumpSettings['disable-keys']) {
1243
            $this->compressManager->write(
1244
                $this->typeAdapter->end_add_disable_keys($tableName)
1245
            );
1246
        }
1247
1248
        if ($this->dumpSettings['add-locks']) {
1249
            $this->compressManager->write(
1250
                $this->typeAdapter->end_add_lock_table($tableName)
1251
            );
1252
        }
1253
1254
        if ($this->dumpSettings['single-transaction']) {
1255
            $this->dbHandler->exec($this->typeAdapter->commit_transaction());
1256
        }
1257
1258
        if ($this->dumpSettings['lock-tables'] && !$this->dumpSettings['single-transaction']) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1259
            $this->typeAdapter->unlock_table($tableName);
1260
        }
1261
1262
        // 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...
1263
        if ($this->dumpSettings['no-autocommit']) {
1264
            $this->compressManager->write(
1265
                $this->typeAdapter->end_disable_autocommit()
1266
            );
1267
        }
1268
1269
        $this->compressManager->write(PHP_EOL);
1270
1271
        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...
1272
            $this->compressManager->write(
1273
                "-- 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 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...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1274
                '--'.PHP_EOL.PHP_EOL
1275
            );
1276
        }
1277
1278
        return;
0 ignored issues
show
Coding Style introduced by
Empty return statement not required here
Loading history...
1279
    }
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...
1280
1281
    /**
1282
     * Build SQL List of all columns on current table which will be used for selecting
1283
     *
1284
     * @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...
1285
     *
1286
     * @return array SQL sentence with columns for select
1287
     */
1288
    public function getColumnStmt($tableName)
1289
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1290
        $colStmt = array();
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1291
        foreach ($this->tableColumnTypes[$tableName] as $colName => $colType) {
1292
            if ($colType['type'] == 'bit' && $this->dumpSettings['hex-blob']) {
0 ignored issues
show
Coding Style introduced by
Operator == prohibited; use === instead
Loading history...
1293
                $colStmt[] = "LPAD(HEX(`${colName}`),2,'0') AS `${colName}`";
1294
            } 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...
1295
                $colStmt[] = "HEX(`${colName}`) AS `${colName}`";
1296
            } elseif ($colType['is_virtual']) {
0 ignored issues
show
Coding Style introduced by
Usage of ELSEIF not allowed; use ELSE IF instead
Loading history...
1297
                $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...
1298
                continue;
1299
            } else {
1300
                $colStmt[] = "`${colName}`";
1301
            }
1302
        }
1303
1304
        return $colStmt;
1305
    }
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...
1306
1307
    /**
1308
     * Build SQL List of all columns on current table which will be used for inserting
1309
     *
1310
     * @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...
1311
     *
1312
     * @return array columns for sql sentence for insert
1313
     */
1314
    public function getColumnNames($tableName)
1315
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1316
        $colNames = array();
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1317
        foreach ($this->tableColumnTypes[$tableName] as $colName => $colType) {
1318
            if ($colType['is_virtual']) {
1319
                $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...
1320
                continue;
1321
            } else {
1322
                $colNames[] = "`${colName}`";
1323
            }
1324
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1325
        return $colNames;
1326
    }
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...
1327
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1328
1329
/**
1330
 * Enum with all available compression methods
1331
 *
1332
 */
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...
1333
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...
1334
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class CompressMethod
Loading history...
1335
    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...
1336
        Mysqldump::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...
1337
        Mysqldump::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...
1338
        Mysqldump::BZIP2,
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...
1339
        Mysqldump::GZIPSTREAM,
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...
1340
    );
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...
1341
1342
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
1343
     * @param string $c
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1344
     * @return boolean
1345
     */
1346
    public static function isValid($c)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
1347
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1348
        return in_array($c, self::$enums);
1349
    }
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...
1350
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1351
1352
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...
1353
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class CompressManagerFactory
Loading history...
1354
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
1355
     * @param string $c
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1356
     * @return CompressBzip2|CompressGzip|CompressNone
1357
     */
0 ignored issues
show
Coding Style Documentation introduced by
Missing @throws tag in function comment
Loading history...
1358
    public static function create($c)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 0 found
Loading history...
1359
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1360
        $c = ucfirst(strtolower($c));
1361
        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...
1362
            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...
1363
        }
1364
1365
        $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...
1366
1367
        return new $method;
1368
    }
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...
1369
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1370
1371
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...
1372
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class CompressBzip2
Loading history...
1373
    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...
1374
1375
    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...
1376
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1377
        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...
1378
            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...
1379
        }
1380
    }
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...
1381
1382
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
1383
     * @param string $filename
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1384
     */
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...
1385
    public function open($filename)
1386
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1387
        $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...
1388
        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...
1389
            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...
1390
        }
1391
1392
        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...
1393
    }
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...
1394
1395
    public function write($str)
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
1396
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1397
        $bytesWritten = bzwrite($this->fileHandler, $str);
1398
        if (false === $bytesWritten) {
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...
1399
            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...
1400
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1401
        return $bytesWritten;
1402
    }
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...
1403
1404
    public function close()
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
1405
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1406
        return bzclose($this->fileHandler);
1407
    }
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...
1408
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1409
1410
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...
1411
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class CompressGzip
Loading history...
1412
    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...
1413
1414
    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...
1415
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1416
        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...
1417
            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...
1418
        }
1419
    }
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...
1420
1421
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
1422
     * @param string $filename
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1423
     */
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...
1424
    public function open($filename)
1425
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1426
        $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...
1427
        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...
1428
            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...
1429
        }
1430
1431
        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...
1432
    }
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...
1433
1434
    public function write($str)
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
1435
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1436
        $bytesWritten = gzwrite($this->fileHandler, $str);
1437
        if (false === $bytesWritten) {
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...
1438
            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...
1439
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1440
        return $bytesWritten;
1441
    }
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...
1442
1443
    public function close()
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
1444
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1445
        return gzclose($this->fileHandler);
1446
    }
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...
1447
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1448
1449
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...
1450
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class CompressNone
Loading history...
1451
    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...
1452
1453
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
1454
     * @param string $filename
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1455
     */
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...
1456
    public function open($filename)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
1457
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1458
        $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...
1459
        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...
1460
            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...
1461
        }
1462
1463
        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...
1464
    }
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...
1465
1466
    public function write($str)
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
1467
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1468
        $bytesWritten = fwrite($this->fileHandler, $str);
1469
        if (false === $bytesWritten) {
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...
1470
            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...
1471
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1472
        return $bytesWritten;
1473
    }
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...
1474
1475
    public function close()
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
1476
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1477
        return fclose($this->fileHandler);
1478
    }
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...
1479
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1480
1481
class CompressGzipstream 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...
1482
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class CompressGzipstream
Loading history...
1483
  private $fileHandler = null;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 2
Loading history...
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...
1484
1485
  private $compressContext;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 2
Loading history...
Coding Style introduced by
Private member variable "compressContext" must contain a leading underscore
Loading history...
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
Coding Style introduced by
Private member variable "compressContext" must be prefixed with an underscore
Loading history...
1486
1487
  /**
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 4 spaces, found 2
Loading history...
Coding Style introduced by
Missing short description in doc comment
Loading history...
1488
   * @param string $filename
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1489
   */
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...
1490
  public function open($filename)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 2
Loading history...
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
1491
  {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 4 spaces, found 2
Loading history...
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1492
    $this->fileHandler = fopen($filename, "wb");
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 8 spaces, found 4
Loading history...
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...
1493
    if (false === $this->fileHandler) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 4
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...
1494
      throw new Exception("Output file is not writable");
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 12 spaces, found 6
Loading history...
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...
1495
    }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 4
Loading history...
1496
1497
    $this->compressContext = deflate_init(ZLIB_ENCODING_GZIP, array('level' => 9));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 8 spaces, found 4
Loading history...
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1498
    return true;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 8 spaces, found 4
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...
1499
  }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 2
Loading history...
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...
1500
1501
  public function write($str)
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 2
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1502
  {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 4 spaces, found 2
Loading history...
Coding Style introduced by
Expected 0 blank lines after opening function brace; 1 found
Loading history...
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1503
1504
    $bytesWritten = fwrite($this->fileHandler, deflate_add($this->compressContext, $str, ZLIB_NO_FLUSH));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 8 spaces, found 4
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...
1505
    if (false === $bytesWritten) {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 4
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...
1506
      throw new Exception("Writting to file failed! Probably, there is no more free space left?");
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 12 spaces, found 6
Loading history...
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...
1507
    }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 8 spaces, found 4
Loading history...
Coding Style introduced by
No blank line found after control structure
Loading history...
1508
    return $bytesWritten;
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 8 spaces, found 4
Loading history...
1509
  }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 2
Loading history...
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...
1510
1511
  public function close()
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 2
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1512
  {
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 4 spaces, found 2
Loading history...
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1513
    fwrite($this->fileHandler, deflate_add($this->compressContext, '', ZLIB_FINISH));
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 8 spaces, found 4
Loading history...
1514
    return fclose($this->fileHandler);
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected at least 8 spaces, found 4
Loading history...
1515
  }
0 ignored issues
show
Coding Style introduced by
Line indented incorrectly; expected 4 spaces, found 2
Loading history...
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...
1516
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1517
1518
/**
1519
 * Enum with all available TypeAdapter implementations
1520
 *
1521
 */
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...
1522
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...
1523
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class TypeAdapter
Loading history...
1524
    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...
1525
        "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...
1526
        "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...
1527
    );
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...
1528
1529
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
1530
     * @param string $c
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
1531
     * @return boolean
1532
     */
1533
    public static function isValid($c)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
1534
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1535
        return in_array($c, self::$enums);
1536
    }
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...
1537
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1538
1539
/**
1540
 * TypeAdapter Factory
1541
 *
1542
 */
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...
1543
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...
1544
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class TypeAdapterFactory
Loading history...
1545
    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...
1546
    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...
1547
1548
    /**
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...
1549
     * @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...
1550
     * @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...
1551
     */
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...
1552
    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...
1553
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1554
        $c = ucfirst(strtolower($c));
1555
        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...
1556
            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...
1557
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1558
        $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...
1559
        return new $method($dbHandler, $dumpSettings);
1560
    }
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...
1561
1562
    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...
1563
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1564
        $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...
1565
        $this->dumpSettings = $dumpSettings;
1566
    }
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...
1567
1568
    /**
1569
     * 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...
1570
     * @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...
1571
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
1572
    public function databases()
1573
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1574
        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...
1575
    }
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...
1576
1577
    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...
1578
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1579
        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...
1580
            "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...
1581
            "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...
1582
    }
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...
1583
1584
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $row should have a doc-comment as per coding-style.
Loading history...
1585
     * 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...
1586
     * @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...
1587
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
1588
    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...
1589
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1590
        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...
1591
    }
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...
1592
1593
    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...
1594
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1595
        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...
1596
            "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...
1597
            "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...
1598
    }
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...
1599
1600
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $row should have a doc-comment as per coding-style.
Loading history...
1601
     * 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...
1602
     * @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...
1603
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
1604
    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...
1605
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1606
        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...
1607
    }
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...
1608
1609
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $triggerName should have a doc-comment as per coding-style.
Loading history...
1610
     * 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...
1611
     * @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...
1612
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
1613
    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...
1614
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1615
        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...
1616
    }
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...
1617
1618
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $triggerName should have a doc-comment as per coding-style.
Loading history...
1619
     * 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...
1620
     * @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...
1621
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
1622
    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...
1623
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1624
        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...
1625
    }
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...
1626
1627
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $procedureName should have a doc-comment as per coding-style.
Loading history...
1628
     * 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...
1629
     * @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...
1630
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
1631
    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...
1632
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1633
        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...
1634
    }
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...
1635
1636
    /**
0 ignored issues
show
Coding Style introduced by
Parameter $functionName should have a doc-comment as per coding-style.
Loading history...
1637
     * function create_function Modify function code, add delimiters, etc
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
1638
     * @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...
1639
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
1640
    public function create_function($functionName)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::create_function" is not in camel caps format
Loading history...
1641
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1642
        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...
1643
    }
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_function()
Loading history...
1644
1645
    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...
1646
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1647
        return "SELECT tbl_name FROM sqlite_master WHERE type='table'";
1648
    }
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...
1649
1650
    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...
1651
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1652
        return "SELECT tbl_name FROM sqlite_master WHERE type='view'";
1653
    }
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...
1654
1655
    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...
1656
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1657
        return "SELECT name FROM sqlite_master WHERE type='trigger'";
1658
    }
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...
1659
1660
    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...
1661
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1662
        if (func_num_args() != 1) {
0 ignored issues
show
Coding Style introduced by
Operator != prohibited; use !== instead
Loading history...
1663
            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...
1664
        }
1665
1666
        $args = func_get_args();
1667
1668
        return "pragma table_info(${args[0]})";
1669
    }
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...
1670
1671
    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...
1672
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1673
        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...
1674
    }
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...
1675
1676
    public function show_functions()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterFactory::show_functions" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1677
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1678
        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...
1679
    }
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_functions()
Loading history...
1680
1681
    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...
1682
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1683
        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...
1684
    }
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...
1685
1686
    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...
1687
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1688
        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...
1689
    }
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...
1690
1691
    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...
1692
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1693
        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...
1694
    }
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...
1695
1696
    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...
1697
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1698
        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...
1699
    }
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...
1700
1701
    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...
1702
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1703
        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...
1704
    }
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...
1705
1706
    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...
1707
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1708
        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...
1709
    }
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...
1710
1711
    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...
1712
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1713
        return PHP_EOL;
1714
    }
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...
1715
1716
    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...
1717
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1718
        return PHP_EOL;
1719
    }
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...
1720
1721
    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...
1722
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1723
        return PHP_EOL;
1724
    }
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...
1725
1726
    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...
1727
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1728
        return PHP_EOL;
1729
    }
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...
1730
1731
    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...
1732
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1733
        return PHP_EOL;
1734
    }
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...
1735
1736
    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...
1737
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1738
        return PHP_EOL;
1739
    }
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...
1740
1741
    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...
1742
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1743
        return PHP_EOL;
1744
    }
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...
1745
1746
    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...
1747
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1748
        return PHP_EOL;
1749
    }
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...
1750
1751
    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...
1752
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1753
        return PHP_EOL;
1754
    }
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...
1755
1756
    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...
1757
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1758
        return PHP_EOL;
1759
    }
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...
1760
1761
    /**
1762
     * Decode column metadata and fill info structure.
1763
     * type, is_numeric and is_blob will always be available.
1764
     *
1765
     * @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...
1766
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
1767
     */
1768
    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...
1769
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1770
        return array();
0 ignored issues
show
Coding Style introduced by
Short array syntax must be used to define arrays
Loading history...
1771
    }
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...
1772
1773
    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...
1774
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1775
        return PHP_EOL;
1776
    }
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...
1777
1778
    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...
1779
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1780
        return PHP_EOL;
1781
    }
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...
1782
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1783
1784
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...
1785
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class TypeAdapterPgsql
Loading history...
1786
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1787
1788
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...
1789
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class TypeAdapterDblib
Loading history...
1790
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1791
1792
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...
1793
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class TypeAdapterSqlite
Loading history...
1794
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
1795
1796
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...
1797
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class TypeAdapterMysql
Loading history...
1798
    const DEFINER_RE = 'DEFINER=`(?:[^`]|``)*`@`(?:[^`]|``)*`';
1799
1800
1801
    // 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...
1802
    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...
1803
        '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...
1804
            '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...
1805
            '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...
1806
            '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...
1807
            '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...
1808
            '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...
1809
            '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...
1810
            '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...
1811
            '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...
1812
            '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...
1813
            '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...
1814
            '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...
1815
            '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...
1816
        ),
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...
1817
        '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...
1818
            '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...
1819
            '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...
1820
            '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...
1821
            '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...
1822
            '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...
1823
            '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...
1824
            '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...
1825
            '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...
1826
            '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...
1827
            '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...
1828
            '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...
1829
            '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...
1830
            '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...
1831
            '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...
1832
            '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...
1833
        )
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...
1834
    );
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...
1835
1836
    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...
1837
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1838
        $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...
1839
        $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...
1840
        $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...
1841
1842
        $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...
1843
        $characterSet = $resultSet->fetchColumn(1);
1844
        $resultSet->closeCursor();
1845
1846
        $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...
1847
        $collationDb = $resultSet->fetchColumn(1);
1848
        $resultSet->closeCursor();
1849
        $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...
1850
1851
        $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...
1852
            " /*!40100 DEFAULT CHARACTER SET ${characterSet} ".
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1853
            " COLLATE ${collationDb} */;".PHP_EOL.PHP_EOL.
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
1854
            "USE `${databaseName}`;".PHP_EOL.PHP_EOL;
1855
1856
        return $ret;
1857
    }
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...
1858
1859
    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...
1860
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1861
        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...
1862
    }
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...
1863
1864
    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...
1865
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1866
        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...
1867
    }
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...
1868
1869
    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...
1870
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1871
        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...
1872
    }
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...
1873
1874
    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...
1875
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1876
        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...
1877
    }
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...
1878
1879
    public function show_create_function($functionName)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::show_create_function" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1880
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1881
        return "SHOW CREATE FUNCTION `$functionName`";
0 ignored issues
show
Coding Style Best Practice introduced by
As per coding-style, please use concatenation or sprintf for the variable $functionName 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...
1882
    }
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_function()
Loading history...
1883
1884
    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...
1885
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1886
        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...
1887
    }
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...
1888
1889
    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...
1890
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1891
        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...
1892
            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...
1893
        }
1894
1895
        $createTable = $row['Create Table'];
1896
        if ($this->dumpSettings['reset-auto-increment']) {
1897
            $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...
1898
            $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...
1899
            $createTable = preg_replace($match, $replace, $createTable);
1900
        }
1901
1902
        $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...
1903
            "/*!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...
1904
            $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...
1905
            "/*!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...
1906
            PHP_EOL;
1907
        return $ret;
1908
    }
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...
1909
1910
    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...
1911
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1912
        $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...
1913
        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...
1914
            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...
1915
        }
1916
1917
        $viewStmt = $row['Create View'];
1918
1919
        $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...
1920
1921
        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...
1922
            '/^(CREATE(?:\s+ALGORITHM=(?:UNDEFINED|MERGE|TEMPTABLE))?)\s+('
1923
            .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...
1924
            '/*!50001 \1 */'.PHP_EOL.$definerStr.'/*!50001 \3 */',
1925
            $viewStmt,
1926
            1
1927
        )) {
0 ignored issues
show
Coding Style introduced by
Closing parenthesis of a multi-line IF statement must be on a new line
Loading history...
1928
            $viewStmt = $viewStmtReplaced;
1929
        };
1930
1931
        $ret .= $viewStmt.';'.PHP_EOL.PHP_EOL;
1932
        return $ret;
1933
    }
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...
1934
1935
    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...
1936
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1937
        $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...
1938
        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...
1939
            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...
1940
        }
1941
1942
        $triggerStmt = $row['SQL Original Statement'];
1943
        $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...
1944
        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...
1945
            '/^(CREATE)\s+('.self::DEFINER_RE.')?\s+(TRIGGER\s.*)$/s',
1946
            '/*!50003 \1*/ '.$definerStr.'/*!50003 \3 */',
1947
            $triggerStmt,
1948
            1
1949
        )) {
0 ignored issues
show
Coding Style introduced by
Closing parenthesis of a multi-line IF statement must be on a new line
Loading history...
1950
            $triggerStmt = $triggerStmtReplaced;
1951
        }
1952
1953
        $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...
1954
            $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...
1955
            "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...
1956
        return $ret;
1957
    }
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...
1958
1959
    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...
1960
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1961
        $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...
1962
        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...
1963
            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...
1964
                "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...
1965
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1966
        $procedureStmt = $row['Create Procedure'];
1967
        if ( $this->dumpSettings['skip-definer'] ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
First condition of a multi-line IF statement must directly follow the opening parenthesis
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
1968
            if ($procedureStmtReplaced = preg_replace(
0 ignored issues
show
Coding Style introduced by
Assignments must be the first block of code on a line
Loading history...
1969
                '/^(CREATE)\s+('.self::DEFINER_RE.')?\s+(PROCEDURE\s.*)$/s',
1970
                '\1 \3',
1971
                $procedureStmt,
1972
                1
1973
            )) {
0 ignored issues
show
Coding Style introduced by
Closing parenthesis of a multi-line IF statement must be on a new line
Loading history...
1974
                $procedureStmt = $procedureStmtReplaced;
1975
            }
1976
        }
1977
1978
        $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...
1979
            $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...
1980
            "/*!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...
1981
            "/*!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...
1982
            "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...
1983
            $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...
1984
            "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...
1985
            "/*!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...
1986
1987
        return $ret;
1988
    }
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...
1989
1990
    public function create_function($row)
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::create_function" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
1991
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
1992
        $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...
1993
        if (!isset($row['Create Function'])) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
1994
            throw new Exception("Error getting function 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 function 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...
1995
                "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...
1996
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
1997
        $functionStmt = $row['Create Function'];
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 8 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...
1998
        $characterSetClient = $row['character_set_client'];
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...
1999
        $collationConnection = $row['collation_connection'];
2000
        $sqlMode = $row['sql_mode'];
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 13 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...
2001
        if ( $this->dumpSettings['skip-definer'] ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
First condition of a multi-line IF statement must directly follow the opening parenthesis
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
2002
            if ($functionStmtReplaced = preg_replace(
0 ignored issues
show
Coding Style introduced by
Assignments must be the first block of code on a line
Loading history...
2003
                '/^(CREATE)\s+('.self::DEFINER_RE.')?\s+(FUNCTION\s.*)$/s',
2004
                '\1 \3',
2005
                $functionStmt,
2006
                1
2007
            )) {
0 ignored issues
show
Coding Style introduced by
Closing parenthesis of a multi-line IF statement must be on a new line
Loading history...
2008
                $functionStmt = $functionStmtReplaced;
2009
            }
2010
        }
2011
2012
        $ret .= "/*!50003 DROP FUNCTION IF EXISTS `".
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 DROP FUNCTION 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...
2013
            $row['Function']."` */;".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...
2014
            "/*!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...
2015
            "/*!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...racter_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...
2016
            "/*!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_...llation_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...
2017
            "/*!40101 SET character_set_client = ".$characterSetClient." */;".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
Concat operator must not be surrounded by spaces
Loading history...
2018
            "/*!40101 SET character_set_results = ".$characterSetClient." */;".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...
Coding Style Comprehensibility introduced by
The string literal /*!40101 SET character_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...
2019
            "/*!50003 SET collation_connection  = ".$collationConnection." */ ;".PHP_EOL.
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50003 SET collation_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 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...
2020
            "/*!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...
2021
            "/*!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...
2022
            "/*!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...
2023
            "/*!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...
2024
            "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...
2025
            $functionStmt." ;;".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...
2026
            "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...
2027
            "/*!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...
2028
            "/*!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...
2029
            "/*!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...
2030
            "/*!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...ved_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...
2031
            "/*!50106 SET TIME_ZONE= @saved_time_zone */ ;".PHP_EOL.PHP_EOL;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!50106 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...
2032
0 ignored issues
show
Coding Style introduced by
Functions must not contain multiple empty lines in a row; found 2 empty lines
Loading history...
2033
2034
        return $ret;
2035
    }
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_function()
Loading history...
2036
2037
    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...
2038
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2039
        $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...
2040
        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...
2041
            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...
2042
                "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...
2043
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
2044
        $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...
2045
        $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...
2046
        $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...
2047
        $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...
2048
2049
        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...
2050
            '/^(CREATE)\s+('.self::DEFINER_RE.')?\s+(EVENT .*)$/',
2051
            '/*!50106 \1*/ '.$definerStr.'/*!50106 \3 */',
2052
            $eventStmt,
2053
            1
2054
        )) {
0 ignored issues
show
Coding Style introduced by
Closing parenthesis of a multi-line IF statement must be on a new line
Loading history...
2055
            $eventStmt = $eventStmtReplaced;
2056
        }
2057
2058
        $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...
2059
            "/*!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...
2060
            "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...
2061
            "/*!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...
2062
            "/*!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...
2063
            "/*!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...
2064
            "/*!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...
2065
            "/*!50003 SET character_set_results = utf8 */ ;;".PHP_EOL.
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
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...
2066
            "/*!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...
2067
            "/*!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...
2068
            "/*!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...
2069
            "/*!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...
2070
            "/*!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...
2071
            $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...
2072
            "/*!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...
2073
            "/*!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...
2074
            "/*!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...
2075
            "/*!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...
2076
            "/*!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...
2077
            "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...
2078
            "/*!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...
2079
            // Commented because we are doing this in restore_parameters()
2080
            // "/*!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...
2081
2082
        return $ret;
2083
    }
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...
2084
2085
    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...
2086
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2087
        $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...
2088
        $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...
2089
        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...
2090
            "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...
2091
            "WHERE TABLE_TYPE='BASE TABLE' AND TABLE_SCHEMA='${args[0]}'";
2092
    }
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...
2093
2094
    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...
2095
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2096
        $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...
2097
        $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...
2098
        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...
2099
            "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...
2100
            "WHERE TABLE_TYPE='VIEW' AND TABLE_SCHEMA='${args[0]}'";
2101
    }
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...
2102
2103
    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...
2104
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2105
        $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...
2106
        $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...
2107
        return "SHOW TRIGGERS FROM `${args[0]}`;";
2108
    }
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...
2109
2110
    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...
2111
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2112
        $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...
2113
        $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...
2114
        return "SHOW COLUMNS FROM `${args[0]}`;";
2115
    }
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...
2116
2117
    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...
2118
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2119
        $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...
2120
        $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...
2121
        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...
2122
            "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...
2123
            "WHERE ROUTINE_TYPE='PROCEDURE' AND ROUTINE_SCHEMA='${args[0]}'";
2124
    }
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...
2125
2126
    public function show_functions()
0 ignored issues
show
Coding Style introduced by
Public method name "TypeAdapterMysql::show_functions" is not in camel caps format
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
2127
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2128
        $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...
2129
        $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...
2130
        return "SELECT SPECIFIC_NAME AS function_name ".
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal SELECT SPECIFIC_NAME AS function_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...
2131
            "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...
2132
            "WHERE ROUTINE_TYPE='FUNCTION' AND ROUTINE_SCHEMA='${args[0]}'";
2133
    }
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_functions()
Loading history...
2134
2135
    /**
2136
     * Get query string to ask for names of events from current database.
2137
     *
2138
     * @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...
2139
     * @return string
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
2140
     */
2141
    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...
2142
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2143
        $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...
2144
        $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...
2145
        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...
2146
            "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...
2147
            "WHERE EVENT_SCHEMA='${args[0]}'";
2148
    }
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...
2149
2150
    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...
2151
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2152
        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...
2153
    }
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...
2154
2155
    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...
2156
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2157
        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...
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
2158
            "/*!40100 WITH CONSISTENT SNAPSHOT */";
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal /*!40100 WITH CONSISTENT SNAPSHOT */ 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...
2159
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end start_transaction()
Loading history...
2160
2161
2162
    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...
2163
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2164
        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...
2165
    }
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...
2166
2167
    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...
2168
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2169
        $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...
2170
        $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...
2171
        return $this->dbHandler->exec("LOCK TABLES `${args[0]}` READ LOCAL");
2172
    }
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...
2173
2174
    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...
2175
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2176
        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...
2177
    }
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...
2178
2179
    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...
2180
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2181
        $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...
2182
        $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...
2183
        return "LOCK TABLES `${args[0]}` WRITE;".PHP_EOL;
2184
    }
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...
2185
2186
    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...
2187
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2188
        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...
2189
    }
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...
2190
2191
    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...
2192
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2193
        $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...
2194
        $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...
2195
        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...
2196
            PHP_EOL;
2197
    }
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...
2198
2199
    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...
2200
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2201
        $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...
2202
        $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...
2203
        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...
2204
            PHP_EOL;
2205
    }
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...
2206
2207
    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...
2208
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2209
        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...
2210
    }
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...
2211
2212
    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...
2213
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2214
        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...
2215
    }
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...
2216
2217
    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...
2218
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2219
        $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...
2220
        $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...
2221
        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...
2222
            PHP_EOL.PHP_EOL;
2223
    }
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...
2224
2225
    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...
2226
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2227
        $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...
2228
        $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...
2229
        return "DROP TRIGGER IF EXISTS `${args[0]}`;".PHP_EOL;
2230
    }
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...
2231
2232
    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...
2233
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2234
        $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...
2235
        $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...
2236
        return "DROP TABLE IF EXISTS `${args[0]}`;".PHP_EOL;
2237
    }
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...
2238
2239
    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...
2240
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2241
        $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...
2242
        $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...
2243
        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...
2244
                "/*!50001 DROP VIEW IF EXISTS `${args[0]}`*/;".PHP_EOL;
2245
    }
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...
2246
2247
    public function getDatabaseHeader()
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
2248
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2249
        $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...
2250
        $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...
2251
        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...
2252
            "-- Current Database: `${args[0]}`".PHP_EOL.
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
2253
            "--".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...
2254
    }
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...
2255
2256
    /**
2257
     * Decode column metadata and fill info structure.
2258
     * type, is_numeric and is_blob will always be available.
2259
     *
2260
     * @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...
2261
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
2262
     */
2263
    public function parseColumnType($colType)
0 ignored issues
show
introduced by
Type hint "array" missing for $colType
Loading history...
2264
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2265
        $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...
2266
        $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...
2267
2268
        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...
2269
            $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...
2270
            $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...
2271
            $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...
2272
        } else {
2273
            $colInfo['type'] = $colParts[0];
2274
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
2275
        $colInfo['is_numeric'] = in_array($colInfo['type'], $this->mysqlTypes['numerical']);
2276
        $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...
2277
        // 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...
2278
        // could by "STORED GENERATED" or "VIRTUAL GENERATED"
2279
        // 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...
2280
        $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...
2281
2282
        return $colInfo;
2283
    }
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...
2284
2285
    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...
2286
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2287
        $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...
2288
            "/*!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...
2289
            "/*!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...
2290
            "/*!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...
2291
2292
        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...
2293
            $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...
2294
                "/*!40103 SET TIME_ZONE='+00:00' */;".PHP_EOL;
2295
        }
2296
2297
        $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...
2298
            "/*!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...
2299
            "/*!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...
2300
            "/*!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...
2301
2302
        return $ret;
2303
    }
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...
2304
2305
    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...
2306
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2307
        $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...
2308
2309
        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...
2310
            $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...
2311
        }
2312
2313
        $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...
2314
            "/*!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...
2315
            "/*!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...
2316
            "/*!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...
2317
            "/*!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...
2318
            "/*!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...
2319
            "/*!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...
2320
2321
        return $ret;
2322
    }
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...
2323
2324
    /**
2325
     * Check number of parameters passed to function, useful when inheriting.
2326
     * Raise exception if unexpected.
2327
     *
2328
     * @param integer $num_args
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
2329
     * @param integer $expected_num_args
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
2330
     * @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...
2331
     */
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...
2332
    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...
2333
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
2334
        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...
2335
            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...
2336
        }
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
2337
        return;
0 ignored issues
show
Coding Style introduced by
Empty return statement not required here
Loading history...
2338
    }
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...
2339
}
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...
2340