Passed
Push — main ( 04eeaf...4d8086 )
by Thierry
04:48 queued 03:06
created
src/Db/Query.php 1 patch
Spacing   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,9 +18,7 @@
 block discarded – undo
18 18
      */
19 19
     protected function limitToOne(string $table, string $query, string $where)
20 20
     {
21
-        return (preg_match('~^INTO~', $query) ? $this->driver->limit($query, $where, 1, 0) :
22
-            " $query" . ($this->driver->isView($this->driver->tableStatusOrName($table)) ? $where :
23
-            " WHERE ctid = (SELECT ctid FROM " . $this->driver->table($table) . $where . ' LIMIT 1)'));
21
+        return (preg_match('~^INTO~', $query) ? $this->driver->limit($query, $where, 1, 0) : " $query" . ($this->driver->isView($this->driver->tableStatusOrName($table)) ? $where : " WHERE ctid = (SELECT ctid FROM " . $this->driver->table($table) . $where . ' LIMIT 1)'));
24 22
     }
25 23
 
26 24
     /**
Please login to merge, or discard this patch.
src/Db/Database.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,8 +82,7 @@  discard block
 block discarded – undo
82 82
             if ($val[0] != 'INDEX') {
83 83
                 //! descending UNIQUE indexes results in syntax error
84 84
                 $create[] = (
85
-                    $val[2] == 'DROP' ? "\nDROP CONSTRAINT " . $this->driver->escapeId($val[1]) :
86
-                    "\nADD" . ($val[1] != '' ? ' CONSTRAINT ' . $this->driver->escapeId($val[1]) : '') .
85
+                    $val[2] == 'DROP' ? "\nDROP CONSTRAINT " . $this->driver->escapeId($val[1]) : "\nADD" . ($val[1] != '' ? ' CONSTRAINT ' . $this->driver->escapeId($val[1]) : '') .
87 86
                     " $val[0] " . ($val[0] == 'PRIMARY' ? 'KEY ' : '') . '(' . implode(', ', $val[2]) . ')'
88 87
                 );
89 88
             } elseif ($val[2] == 'DROP') {
@@ -196,7 +195,7 @@  discard block
 block discarded – undo
196 195
      */
197 196
     public function truncateTables(array $tables)
198 197
     {
199
-        $this->driver->execute('TRUNCATE ' . implode(', ', array_map(function ($table) {
198
+        $this->driver->execute('TRUNCATE ' . implode(', ', array_map(function($table) {
200 199
             return $this->driver->table($table);
201 200
         }, $tables)));
202 201
         return true;
Please login to merge, or discard this patch.