Passed
Branch main (2a1ad3)
by Thierry
06:07 queued 03:57
created
src/Db/Grammar.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
             if ($name == '') {
43 43
                 continue;
44 44
             }
45
-            $columns = implode(", ", array_map(function ($key) {
45
+            $columns = implode(", ", array_map(function($key) {
46 46
                 return $this->escapeId($key);
47 47
             }, $index->columns));
48 48
             $query .= ";\n\n" . $this->sqlForCreateIndex($table, $index->type, $name, "($columns)");
Please login to merge, or discard this patch.
src/Db/Database.php 1 patch
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             if ($originals && !$this->driver->execute("INSERT INTO " . $this->driver->table($tempName) .
150 150
                 " (" . implode(", ", $originals) . ") SELECT " . implode(
151 151
                     ", ",
152
-                    array_map(function ($key) {
152
+                    array_map(function($key) {
153 153
                    return $this->driver->escapeId($key);
154 154
                }, array_keys($originals))
155 155
                 ) . " FROM " . $this->driver->table($table))) {
@@ -161,8 +161,7 @@  discard block
 block discarded – undo
161 161
                 $triggers[] = "CREATE TRIGGER " . $this->driver->escapeId($trigger_name) . " " .
162 162
                     implode(" ", $timing_event) . " ON " . $this->driver->table($name) . "\n$trigger[Statement]";
163 163
             }
164
-            $autoIncrement = $autoIncrement ? 0 :
165
-                $this->connection->result("SELECT seq FROM sqlite_sequence WHERE name = " .
164
+            $autoIncrement = $autoIncrement ? 0 : $this->connection->result("SELECT seq FROM sqlite_sequence WHERE name = " .
166 165
                 $this->driver->quote($table)); // if $autoIncrement is set then it will be updated later
167 166
             // drop before creating indexes and triggers to allow using old names
168 167
             if (!$this->driver->execute("DROP TABLE " . $this->driver->table($table)) ||
@@ -196,8 +195,7 @@  discard block
 block discarded – undo
196 195
         }
197 196
         foreach (array_reverse($alter) as $val) {
198 197
             if (!$this->driver->execute($val[2] == "DROP" ?
199
-                "DROP INDEX " . $this->driver->escapeId($val[1]) :
200
-                $this->driver->sqlForCreateIndex($table, $val[0], $val[1], "(" . implode(", ", $val[2]) . ")")
198
+                "DROP INDEX " . $this->driver->escapeId($val[1]) : $this->driver->sqlForCreateIndex($table, $val[0], $val[1], "(" . implode(", ", $val[2]) . ")")
201 199
             )) {
202 200
                 return false;
203 201
             }
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
@@ -15,8 +15,7 @@
 block discarded – undo
15 15
     {
16 16
         return preg_match('~^INTO~', $query) ||
17 17
             $this->connection->result("SELECT sqlite_compileoption_used('ENABLE_UPDATE_DELETE_LIMIT')") ?
18
-            $this->driver->limit($query, $where, 1, 0, $separator) :
19
-            //! use primary key in tables with WITHOUT rowid
18
+            $this->driver->limit($query, $where, 1, 0, $separator) : //! use primary key in tables with WITHOUT rowid
20 19
             " $query WHERE rowid = (SELECT rowid FROM " . $this->driver->table($table) . $where . $separator . "LIMIT 1)";
21 20
     }
22 21
 
Please login to merge, or discard this patch.
src/Db/Table.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -130,8 +130,7 @@
 block discarded – undo
130 130
                 "text" : (preg_match('~blob~i', $type) ? "blob" : (preg_match('~real|floa|doub~i', $type) ?
131 131
                 "real" : "numeric"))));
132 132
             $field->fullType = $type;
133
-            $field->default = (preg_match("~'(.*)'~", $default, $match) ? str_replace("''", "'", $match[1]) :
134
-                ($default == "NULL" ? null : $default));
133
+            $field->default = (preg_match("~'(.*)'~", $default, $match) ? str_replace("''", "'", $match[1]) : ($default == "NULL" ? null : $default));
135 134
             $field->null = !$row["notnull"];
136 135
             $field->privileges = ["select" => 1, "insert" => 1, "update" => 1];
137 136
             $field->primary = $row["pk"];
Please login to merge, or discard this patch.