Completed
Push — master ( 409100...1ba1d1 )
by Ivan
03:01
created
src/DriverAbstract.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
         $new = '';
13 13
         $par = array_values($par);
14 14
         if (substr_count($sql, '?') === 2 && !is_array($par[0])) {
15
-            $par = [ $par ];
15
+            $par = [$par];
16 16
         }
17 17
         $parts = explode('??', $sql);
18 18
         $index = 0;
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
             $index += count($tmp) - 1;
23 23
             if (isset($par[$index])) {
24 24
                 if (!is_array($par[$index])) {
25
-                    $par[$index] = [ $par[$index] ];
25
+                    $par[$index] = [$par[$index]];
26 26
                 }
27 27
                 $params = $par[$index];
28 28
                 array_splice($par, $index, 1, $params);
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
                 $new .= implode(',', array_fill(0, count($params), '?'));
31 31
             }
32 32
         }
33
-        return [ $new, $par ];
33
+        return [$new, $par];
34 34
     }
35 35
     /**
36 36
      * Run a query (prepare & execute).
Please login to merge, or discard this patch.
src/driver/postgre/Statement.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
             $data = array();
24 24
         }
25 25
         $temp = (is_array($data) && count($data)) ?
26
-            \pg_query_params($this->driver, $this->statement, $data) :
27
-            \pg_query_params($this->driver, $this->statement, array());
26
+            \pg_query_params($this->driver, $this->statement, $data) : \pg_query_params($this->driver, $this->statement, array());
28 27
         if (!$temp) {
29 28
             throw new DBException('Could not execute query : '.\pg_last_error($this->driver).' <'.$this->statement.'>');
30 29
         }
Please login to merge, or discard this patch.
src/driver/postgre/Result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
     }
63 63
     public function next()
64 64
     {
65
-        $this->fetched ++;
65
+        $this->fetched++;
66 66
         $this->last = \pg_fetch_array($this->statement, null, \PGSQL_ASSOC);
67 67
     }
68 68
     public function valid()
Please login to merge, or discard this patch.
src/driver/oracle/Result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
     }
65 65
     public function next()
66 66
     {
67
-        $this->fetched ++;
67
+        $this->fetched++;
68 68
         $this->last = \oci_fetch_array($this->statement, \OCI_ASSOC + \OCI_RETURN_NULLS + \OCI_RETURN_LOBS);
69 69
     }
70 70
     public function valid()
Please login to merge, or discard this patch.
src/driver/oracle/Driver.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
     public function begin() : bool
77 77
     {
78
-         return $this->transaction = true;
78
+            return $this->transaction = true;
79 79
     }
80 80
     public function commit() : bool
81 81
     {
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                     }
200 200
                     return $new;
201 201
                 })
202
-                 as $relation
202
+                    as $relation
203 203
             ) {
204 204
                 $relations[$relation['CONSTRAINT_NAME']]['table'] = $relation['TABLE_NAME'];
205 205
                 $relations[$relation['CONSTRAINT_NAME']]['keymap'][$primary[(int)$relation['POSITION']-1]] = $relation['COLUMN_NAME'];
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -138,17 +138,17 @@  discard block
 block discarded – undo
138 138
         $columns = Collection::from($this
139 139
             ->query(
140 140
                 "SELECT * FROM all_tab_cols WHERE table_name = ? AND owner = ?",
141
-                [ strtoupper($table), $this->name() ]
141
+                [strtoupper($table), $this->name()]
142 142
             ))
143
-            ->map(function ($v) {
143
+            ->map(function($v) {
144 144
                 $new = [];
145 145
                 foreach ($v as $kk => $vv) {
146 146
                     $new[strtoupper($kk)] = $vv;
147 147
                 }
148 148
                 return $new;
149 149
             })
150
-            ->mapKey(function ($v) { return $v['COLUMN_NAME']; })
151
-            ->map(function ($v) {
150
+            ->mapKey(function($v) { return $v['COLUMN_NAME']; })
151
+            ->map(function($v) {
152 152
                 $v['length'] = null;
153 153
                 if (!isset($v['DATA_TYPE'])) {
154 154
                     return $v;
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                     default:
161 161
                         if (strpos($type, 'char') !== false && strpos($type, '(') !== false) {
162 162
                             // extract length from varchar
163
-                            $v['length'] = (int)explode(')', (explode('(', $type)[1] ?? ''))[0];
163
+                            $v['length'] = (int) explode(')', (explode('(', $type)[1] ?? ''))[0];
164 164
                             $v['length'] = $v['length'] > 0 ? $v['length'] : null;
165 165
                         }
166 166
                         break;
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
             ->query(
177 177
                 "SELECT constraint_name FROM all_constraints
178 178
                 WHERE table_name = ? AND constraint_type = ? AND owner = ?",
179
-                [ strtoupper($table), 'P', $owner ]
179
+                [strtoupper($table), 'P', $owner]
180 180
             ))
181
-            ->map(function ($v) {
181
+            ->map(function($v) {
182 182
                 $new = [];
183 183
                 foreach ($v as $kk => $vv) {
184 184
                     $new[strtoupper($kk)] = $vv;
@@ -193,9 +193,9 @@  discard block
 block discarded – undo
193 193
                 ->query(
194 194
                     "SELECT column_name FROM all_cons_columns
195 195
                     WHERE table_name = ? AND constraint_name = ? AND owner = ?",
196
-                    [ strtoupper($table), $pkname, $owner ]
196
+                    [strtoupper($table), $pkname, $owner]
197 197
                 ))
198
-                ->map(function ($v) {
198
+                ->map(function($v) {
199 199
                     $new = [];
200 200
                     foreach ($v as $kk => $vv) {
201 201
                         $new[strtoupper($kk)] = $vv;
@@ -222,9 +222,9 @@  discard block
 block discarded – undo
222 222
                     LEFT JOIN all_cons_columns cc ON cc.OWNER = ac.OWNER AND cc.CONSTRAINT_NAME = ac.CONSTRAINT_NAME
223 223
                     WHERE ac.OWNER = ? AND ac.R_OWNER = ? AND ac.R_CONSTRAINT_NAME = ? AND ac.CONSTRAINT_TYPE = ?
224 224
                     ORDER BY cc.POSITION",
225
-                    [ $owner, $owner, $pkname, 'R' ]
225
+                    [$owner, $owner, $pkname, 'R']
226 226
                 ))
227
-                ->map(function ($v) {
227
+                ->map(function($v) {
228 228
                     $new = [];
229 229
                     foreach ($v as $kk => $vv) {
230 230
                         $new[strtoupper($kk)] = $vv;
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
                  as $relation
235 235
             ) {
236 236
                 $relations[$relation['CONSTRAINT_NAME']]['table'] = $relation['TABLE_NAME'];
237
-                $relations[$relation['CONSTRAINT_NAME']]['keymap'][$primary[(int)$relation['POSITION']-1]] = $relation['COLUMN_NAME'];
237
+                $relations[$relation['CONSTRAINT_NAME']]['keymap'][$primary[(int) $relation['POSITION'] - 1]] = $relation['COLUMN_NAME'];
238 238
             }
239 239
             foreach ($relations as $data) {
240 240
                 $rtable = $this->table($data['table'], true);
@@ -258,9 +258,9 @@  discard block
 block discarded – undo
258 258
                                 ac.OWNER = ? AND ac.R_OWNER = ? AND ac.TABLE_NAME = ? AND ac.CONSTRAINT_TYPE = ? AND
259 259
                                 cc.COLUMN_NAME IN (??)
260 260
                             ORDER BY POSITION",
261
-                            [ $owner, $owner, $data['table'], 'R', $columns ]
261
+                            [$owner, $owner, $data['table'], 'R', $columns]
262 262
                         ))
263
-                        ->map(function ($v) {
263
+                        ->map(function($v) {
264 264
                             $new = [];
265 265
                             foreach ($v as $kk => $vv) {
266 266
                                 $new[strtoupper($kk)] = $vv;
@@ -278,9 +278,9 @@  discard block
 block discarded – undo
278 278
                     $rcolumns = Collection::from($this
279 279
                         ->query(
280 280
                             "SELECT COLUMN_NAME FROM all_cons_columns WHERE OWNER = ? AND CONSTRAINT_NAME = ? ORDER BY POSITION",
281
-                            [ $owner, current($foreign['keymap']) ]
281
+                            [$owner, current($foreign['keymap'])]
282 282
                         ))
283
-                        ->map(function ($v) {
283
+                        ->map(function($v) {
284 284
                             $new = [];
285 285
                             foreach ($v as $kk => $vv) {
286 286
                                 $new[strtoupper($kk)] = $vv;
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
                     $relname = $foreign['table'];
296 296
                     $cntr = 1;
297 297
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
298
-                        $relname = $foreign['table'] . '_' . (++ $cntr);
298
+                        $relname = $foreign['table'].'_'.(++$cntr);
299 299
                     }
300 300
                     $definition->addRelation(
301 301
                         new TableRelation(
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
                     $relname = $data['table'];
312 312
                     $cntr = 1;
313 313
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
314
-                        $relname = $data['table'] . '_' . (++ $cntr);
314
+                        $relname = $data['table'].'_'.(++$cntr);
315 315
                     }
316 316
                     $definition->addRelation(
317 317
                         new TableRelation(
@@ -335,9 +335,9 @@  discard block
 block discarded – undo
335 335
                     LEFT JOIN all_cons_columns cc ON cc.OWNER = ac.OWNER AND cc.CONSTRAINT_NAME = ac.CONSTRAINT_NAME
336 336
                     WHERE ac.OWNER = ? AND ac.R_OWNER = ? AND ac.TABLE_NAME = ? AND ac.CONSTRAINT_TYPE = ?
337 337
                     ORDER BY cc.POSITION",
338
-                    [ $owner, $owner, strtoupper($table), 'R' ]
338
+                    [$owner, $owner, strtoupper($table), 'R']
339 339
                 ))
340
-                ->map(function ($v) {
340
+                ->map(function($v) {
341 341
                     $new = [];
342 342
                     foreach ($v as $kk => $vv) {
343 343
                         $new[strtoupper($kk)] = $vv;
@@ -353,9 +353,9 @@  discard block
 block discarded – undo
353 353
                 $rcolumns = Collection::from($this
354 354
                     ->query(
355 355
                         "SELECT COLUMN_NAME FROM all_cons_columns WHERE OWNER = ? AND CONSTRAINT_NAME = ? ORDER BY POSITION",
356
-                        [ $owner, current($data['keymap']) ]
356
+                        [$owner, current($data['keymap'])]
357 357
                     ))
358
-                    ->map(function ($v) {
358
+                    ->map(function($v) {
359 359
                         $new = [];
360 360
                         foreach ($v as $kk => $vv) {
361 361
                             $new[strtoupper($kk)] = $vv;
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
                 $relname = $data['table'];
371 371
                 $cntr = 1;
372 372
                 while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
373
-                    $relname = $data['table'] . '_' . (++ $cntr);
373
+                    $relname = $data['table'].'_'.(++$cntr);
374 374
                 }
375 375
                 $definition->addRelation(
376 376
                     new TableRelation(
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
                 "SELECT TABLE_NAME FROM ALL_TABLES where OWNER = ?",
392 392
                 [$this->connection['name']]
393 393
             ))
394
-            ->map(function ($v) {
394
+            ->map(function($v) {
395 395
                 $new = [];
396 396
                 foreach ($v as $kk => $vv) {
397 397
                     $new[strtoupper($kk)] = $vv;
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
                 return $new;
400 400
             })
401 401
             ->pluck('TABLE_NAME')
402
-            ->map(function ($v) {
402
+            ->map(function($v) {
403 403
                 return $this->table($v);
404 404
             })
405 405
             ->toArray();
Please login to merge, or discard this patch.
src/driver/sqlite/Result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
     }
63 63
     public function next()
64 64
     {
65
-        $this->fetched ++;
65
+        $this->fetched++;
66 66
         $this->last = $this->statement->fetchArray(\SQLITE3_ASSOC);
67 67
     }
68 68
     public function valid()
Please login to merge, or discard this patch.
src/driver/sqlite/Driver.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
         parse_str($temp[1], $connection['opts']);
23 23
         $connection['name'] = $temp[0];
24 24
         if (!is_file($connection['name']) && is_file('/'.$connection['name'])) {
25
-           $connection['name'] = '/'.$connection['name'];
25
+            $connection['name'] = '/'.$connection['name'];
26 26
         }
27 27
         $this->connection = $connection;
28 28
     }
Please login to merge, or discard this patch.
src/driver/mysql/Result.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
                 if ($temp) {
30 30
                     $temp = $temp->fetch_fields();
31 31
                     if ($temp) {
32
-                        $columns = array_map(function ($v) { return $v->name; }, $temp);
32
+                        $columns = array_map(function($v) { return $v->name; }, $temp);
33 33
                     }
34 34
                 }
35 35
                 if (count($columns)) {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     }
68 68
     public function current()
69 69
     {
70
-        return $this->nativeDriver ? $this->last : array_map(function ($v) { return $v; }, $this->row);
70
+        return $this->nativeDriver ? $this->last : array_map(function($v) { return $v; }, $this->row);
71 71
     }
72 72
     public function rewind()
73 73
     {
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     }
85 85
     public function next()
86 86
     {
87
-        $this->fetched ++;
87
+        $this->fetched++;
88 88
         $this->last = $this->nativeDriver ? $this->result->fetch_assoc() : $this->statement->fetch();
89 89
     }
90 90
     public function valid()
Please login to merge, or discard this patch.
src/driver/ibase/Result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
     }
68 68
     public function next()
69 69
     {
70
-        $this->fetched ++;
70
+        $this->fetched++;
71 71
         $this->last = \ibase_fetch_assoc($this->result, \IBASE_TEXT);
72 72
     }
73 73
     public function valid()
Please login to merge, or discard this patch.