Passed
Push — main ( f418cb...c16d56 )
by Thierry
03:52 queued 01:52
created
src/Driver.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
         "char" => "md5/sha1/password/encrypt/uuid",
72 72
         "binary" => "md5/sha1",
73 73
         "date|time" => "now",
74
-    ],[
74
+    ], [
75 75
         // $this->numberRegex() => "+/-",
76 76
         "date" => "+ interval/- interval",
77 77
         "time" => "addtime/subtime",
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,8 +95,7 @@
 block discarded – undo
95 95
         $connection = null;
96 96
         if (extension_loaded("pdo_mysql")) {
97 97
             $connection = new Db\Pdo\Connection($this, $this->util, $this->trans, 'PDO_MySQL');
98
-        }
99
-        else {
98
+        } else {
100 99
             throw new AuthException($this->trans->lang('No package installed to connect to a MySQL server.'));
101 100
         }
102 101
 
Please login to merge, or discard this patch.
src/Db/MySqli/Connection.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
12 12
 class Connection extends AbstractConnection
13 13
 {
14 14
     /**
15
-    * @inheritDoc
16
-    */
15
+     * @inheritDoc
16
+     */
17 17
     public function open(string $database, string $schema = '')
18 18
     {
19 19
         $server = $this->driver->options('server');
Please login to merge, or discard this patch.
src/Db/Table.php 1 patch
Spacing   +5 added lines, -8 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@  discard block
 block discarded – undo
25 25
         $query = ($fast && $this->driver->minVersion(5)) ?
26 26
             "SELECT TABLE_NAME AS Name, ENGINE AS Engine, TABLE_COMMENT AS Comment " .
27 27
             "FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() " .
28
-            ($table != "" ? "AND TABLE_NAME = " . $this->driver->quote($table) : "ORDER BY Name") :
29
-            "SHOW TABLE STATUS" . ($table != "" ? " LIKE " . $this->driver->quote(addcslashes($table, "%_\\")) : "");
28
+            ($table != "" ? "AND TABLE_NAME = " . $this->driver->quote($table) : "ORDER BY Name") : "SHOW TABLE STATUS" . ($table != "" ? " LIKE " . $this->driver->quote(addcslashes($table, "%_\\")) : "");
30 29
         return $this->driver->rows($query);
31 30
     }
32 31
 
@@ -142,8 +141,7 @@  discard block
 block discarded – undo
142 141
             $index = new IndexEntity();
143 142
 
144 143
             $name = $row["Key_name"];
145
-            $index->type = ($name == "PRIMARY" ? "PRIMARY" :
146
-                ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ?
144
+            $index->type = ($name == "PRIMARY" ? "PRIMARY" : ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ?
147 145
                 ($row["Index_type"] == "SPATIAL" ? "SPATIAL" : "INDEX") : "UNIQUE")));
148 146
             $index->columns[] = $row["Column_name"];
149 147
             $index->lengths[] = ($row["Index_type"] == "SPATIAL" ? null : $row["Sub_part"]);
@@ -183,10 +181,10 @@  discard block
 block discarded – undo
183 181
 
184 182
                 $foreignKey->database = $this->driver->unescapeId($match4 != "" ? $match3 : $match4);
185 183
                 $foreignKey->table = $this->driver->unescapeId($match4 != "" ? $match4 : $match3);
186
-                $foreignKey->source = array_map(function ($idf) {
184
+                $foreignKey->source = array_map(function($idf) {
187 185
                     return $this->driver->unescapeId($idf);
188 186
                 }, $source[0]);
189
-                $foreignKey->target = array_map(function ($idf) {
187
+                $foreignKey->target = array_map(function($idf) {
190 188
                     return $this->driver->unescapeId($idf);
191 189
                 }, $target[0]);
192 190
                 $foreignKey->onDelete = $matchCount > 6 ? $match[6] : "RESTRICT";
@@ -208,8 +206,7 @@  discard block
 block discarded – undo
208 206
         foreach ($fields as $field) {
209 207
             $alter[] = ($field[1] ? ($table != "" ? ($field[0] != "" ? "CHANGE " .
210 208
                 $this->driver->escapeId($field[0]) : "ADD") : " ") . " " .
211
-                implode($field[1]) . ($table != "" ? $field[2] : "") :
212
-                "DROP " . $this->driver->escapeId($field[0])
209
+                implode($field[1]) . ($table != "" ? $field[2] : "") : "DROP " . $this->driver->escapeId($field[0])
213 210
             );
214 211
         }
215 212
         $alter = array_merge($alter, $foreign);
Please login to merge, or discard this patch.
src/Db/Server.php 1 patch
Spacing   +5 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@  discard block
 block discarded – undo
15 15
     {
16 16
         // !!! Caching and slow query handling are temporarily disabled !!!
17 17
         $query = $this->driver->minVersion(5) ?
18
-            "SELECT SCHEMA_NAME FROM information_schema.SCHEMATA ORDER BY SCHEMA_NAME" :
19
-            "SHOW DATABASES";
18
+            "SELECT SCHEMA_NAME FROM information_schema.SCHEMATA ORDER BY SCHEMA_NAME" : "SHOW DATABASES";
20 19
         return $this->driver->values($query);
21 20
 
22 21
         // SHOW DATABASES can take a very long time so it is cached
@@ -91,8 +90,7 @@  discard block
 block discarded – undo
91 90
     public function tables()
92 91
     {
93 92
         return $this->driver->keyValues($this->driver->minVersion(5) ?
94
-            "SELECT TABLE_NAME, TABLE_TYPE FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() ORDER BY TABLE_NAME" :
95
-            "SHOW TABLES");
93
+            "SELECT TABLE_NAME, TABLE_TYPE FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() ORDER BY TABLE_NAME" : "SHOW TABLES");
96 94
     }
97 95
 
98 96
     /**
@@ -112,7 +110,7 @@  discard block
 block discarded – undo
112 110
      */
113 111
     public function dropViews(array $views)
114 112
     {
115
-        $this->driver->execute("DROP VIEW " . implode(", ", array_map(function ($view) {
113
+        $this->driver->execute("DROP VIEW " . implode(", ", array_map(function($view) {
116 114
             return $this->driver->table($view);
117 115
         }, $views)));
118 116
         return true;
@@ -123,7 +121,7 @@  discard block
 block discarded – undo
123 121
      */
124 122
     public function dropTables(array $tables)
125 123
     {
126
-        $this->driver->execute("DROP TABLE " . implode(", ", array_map(function ($table) {
124
+        $this->driver->execute("DROP TABLE " . implode(", ", array_map(function($table) {
127 125
             return $this->driver->table($table);
128 126
         }, $tables)));
129 127
         return true;
@@ -241,7 +239,7 @@  discard block
 block discarded – undo
241 239
      */
242 240
     public function dropDatabases(array $databases)
243 241
     {
244
-        return $this->driver->applyQueries("DROP DATABASE", $databases, function ($database) {
242
+        return $this->driver->applyQueries("DROP DATABASE", $databases, function($database) {
245 243
             return $this->driver->escapeId($database);
246 244
         });
247 245
     }
Please login to merge, or discard this patch.
src/Db/Query.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
      */
24 24
     public function insert(string $table, array $set)
25 25
     {
26
-        $result = ($set ? parent::insert($table, $set) :
27
-            $this->execute('INSERT INTO ' . $this->driver->table($table) . ' () VALUES ()'));
26
+        $result = ($set ? parent::insert($table, $set) : $this->execute('INSERT INTO ' . $this->driver->table($table) . ' () VALUES ()'));
28 27
         return $result == true;
29 28
     }
30 29
 
Please login to merge, or discard this patch.