Completed
Push — master ( 4a77f9...0c3707 )
by Ivan
03:46
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   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -124,16 +124,16 @@  discard block
 block discarded – undo
124 124
         $columns = Collection::from($this
125 125
             ->query(
126 126
                 "SELECT * FROM all_tab_cols WHERE table_name = ? AND owner = ?",
127
-                [ strtoupper($table), $this->name() ]
127
+                [strtoupper($table), $this->name()]
128 128
             ))
129
-            ->map(function ($v) {
129
+            ->map(function($v) {
130 130
                 $new = [];
131 131
                 foreach ($v as $kk => $vv) {
132 132
                     $new[strtoupper($kk)] = $vv;
133 133
                 }
134 134
                 return $new;
135 135
             })
136
-            ->mapKey(function ($v) { return $v['COLUMN_NAME']; })
136
+            ->mapKey(function($v) { return $v['COLUMN_NAME']; })
137 137
             ->toArray();
138 138
         if (!count($columns)) {
139 139
             throw new DBException('Table not found by name');
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
             ->query(
144 144
                 "SELECT constraint_name FROM all_constraints
145 145
                 WHERE table_name = ? AND constraint_type = ? AND owner = ?",
146
-                [ strtoupper($table), 'P', $owner ]
146
+                [strtoupper($table), 'P', $owner]
147 147
             ))
148
-            ->map(function ($v) {
148
+            ->map(function($v) {
149 149
                 $new = [];
150 150
                 foreach ($v as $kk => $vv) {
151 151
                     $new[strtoupper($kk)] = $vv;
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
                 ->query(
161 161
                     "SELECT column_name FROM all_cons_columns
162 162
                     WHERE table_name = ? AND constraint_name = ? AND owner = ?",
163
-                    [ strtoupper($table), $pkname, $owner ]
163
+                    [strtoupper($table), $pkname, $owner]
164 164
                 ))
165
-                ->map(function ($v) {
165
+                ->map(function($v) {
166 166
                     $new = [];
167 167
                     foreach ($v as $kk => $vv) {
168 168
                         $new[strtoupper($kk)] = $vv;
@@ -189,9 +189,9 @@  discard block
 block discarded – undo
189 189
                     LEFT JOIN all_cons_columns cc ON cc.OWNER = ac.OWNER AND cc.CONSTRAINT_NAME = ac.CONSTRAINT_NAME
190 190
                     WHERE ac.OWNER = ? AND ac.R_OWNER = ? AND ac.R_CONSTRAINT_NAME = ? AND ac.CONSTRAINT_TYPE = ?
191 191
                     ORDER BY cc.POSITION",
192
-                    [ $owner, $owner, $pkname, 'R' ]
192
+                    [$owner, $owner, $pkname, 'R']
193 193
                 ))
194
-                ->map(function ($v) {
194
+                ->map(function($v) {
195 195
                     $new = [];
196 196
                     foreach ($v as $kk => $vv) {
197 197
                         $new[strtoupper($kk)] = $vv;
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
                  as $relation
202 202
             ) {
203 203
                 $relations[$relation['CONSTRAINT_NAME']]['table'] = $relation['TABLE_NAME'];
204
-                $relations[$relation['CONSTRAINT_NAME']]['keymap'][$primary[(int)$relation['POSITION']-1]] = $relation['COLUMN_NAME'];
204
+                $relations[$relation['CONSTRAINT_NAME']]['keymap'][$primary[(int) $relation['POSITION'] - 1]] = $relation['COLUMN_NAME'];
205 205
             }
206 206
             foreach ($relations as $data) {
207 207
                 $rtable = $this->table($data['table'], true);
@@ -225,9 +225,9 @@  discard block
 block discarded – undo
225 225
                                 ac.OWNER = ? AND ac.R_OWNER = ? AND ac.TABLE_NAME = ? AND ac.CONSTRAINT_TYPE = ? AND
226 226
                                 cc.COLUMN_NAME IN (??)
227 227
                             ORDER BY POSITION",
228
-                            [ $owner, $owner, $data['table'], 'R', $columns ]
228
+                            [$owner, $owner, $data['table'], 'R', $columns]
229 229
                         ))
230
-                        ->map(function ($v) {
230
+                        ->map(function($v) {
231 231
                             $new = [];
232 232
                             foreach ($v as $kk => $vv) {
233 233
                                 $new[strtoupper($kk)] = $vv;
@@ -245,9 +245,9 @@  discard block
 block discarded – undo
245 245
                     $rcolumns = Collection::from($this
246 246
                         ->query(
247 247
                             "SELECT COLUMN_NAME FROM all_cons_columns WHERE OWNER = ? AND CONSTRAINT_NAME = ? ORDER BY POSITION",
248
-                            [ $owner, current($foreign['keymap']) ]
248
+                            [$owner, current($foreign['keymap'])]
249 249
                         ))
250
-                        ->map(function ($v) {
250
+                        ->map(function($v) {
251 251
                             $new = [];
252 252
                             foreach ($v as $kk => $vv) {
253 253
                                 $new[strtoupper($kk)] = $vv;
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                     $relname = $foreign['table'];
263 263
                     $cntr = 1;
264 264
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
265
-                        $relname = $foreign['table'] . '_' . (++ $cntr);
265
+                        $relname = $foreign['table'].'_'.(++$cntr);
266 266
                     }
267 267
                     $definition->addRelation(
268 268
                         new TableRelation(
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
                     $relname = $data['table'];
279 279
                     $cntr = 1;
280 280
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
281
-                        $relname = $data['table'] . '_' . (++ $cntr);
281
+                        $relname = $data['table'].'_'.(++$cntr);
282 282
                     }
283 283
                     $definition->addRelation(
284 284
                         new TableRelation(
@@ -302,9 +302,9 @@  discard block
 block discarded – undo
302 302
                     LEFT JOIN all_cons_columns cc ON cc.OWNER = ac.OWNER AND cc.CONSTRAINT_NAME = ac.CONSTRAINT_NAME
303 303
                     WHERE ac.OWNER = ? AND ac.R_OWNER = ? AND ac.TABLE_NAME = ? AND ac.CONSTRAINT_TYPE = ?
304 304
                     ORDER BY cc.POSITION",
305
-                    [ $owner, $owner, strtoupper($table), 'R' ]
305
+                    [$owner, $owner, strtoupper($table), 'R']
306 306
                 ))
307
-                ->map(function ($v) {
307
+                ->map(function($v) {
308 308
                     $new = [];
309 309
                     foreach ($v as $kk => $vv) {
310 310
                         $new[strtoupper($kk)] = $vv;
@@ -320,9 +320,9 @@  discard block
 block discarded – undo
320 320
                 $rcolumns = Collection::from($this
321 321
                     ->query(
322 322
                         "SELECT COLUMN_NAME FROM all_cons_columns WHERE OWNER = ? AND CONSTRAINT_NAME = ? ORDER BY POSITION",
323
-                        [ $owner, current($data['keymap']) ]
323
+                        [$owner, current($data['keymap'])]
324 324
                     ))
325
-                    ->map(function ($v) {
325
+                    ->map(function($v) {
326 326
                         $new = [];
327 327
                         foreach ($v as $kk => $vv) {
328 328
                             $new[strtoupper($kk)] = $vv;
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
                 $relname = $data['table'];
338 338
                 $cntr = 1;
339 339
                 while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
340
-                    $relname = $data['table'] . '_' . (++ $cntr);
340
+                    $relname = $data['table'].'_'.(++$cntr);
341 341
                 }
342 342
                 $definition->addRelation(
343 343
                     new TableRelation(
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
                 "SELECT TABLE_NAME FROM ALL_TABLES where OWNER = ?",
359 359
                 [$this->connection['name']]
360 360
             ))
361
-            ->map(function ($v) {
361
+            ->map(function($v) {
362 362
                 $new = [];
363 363
                 foreach ($v as $kk => $vv) {
364 364
                     $new[strtoupper($kk)] = $vv;
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
                 return $new;
367 367
             })
368 368
             ->pluck('TABLE_NAME')
369
-            ->map(function ($v) {
369
+            ->map(function($v) {
370 370
                 return $this->table($v);
371 371
             })
372 372
             ->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/mysql/Driver.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     {
37 37
         if ($this->lnk === null) {
38 38
             $this->lnk = new \mysqli(
39
-                (isset($this->connection['opts']['persist']) && $this->connection['opts']['persist'] ? 'p:' : '') .
39
+                (isset($this->connection['opts']['persist']) && $this->connection['opts']['persist'] ? 'p:' : '').
40 40
                     $this->connection['host'],
41 41
                 $this->connection['user'],
42 42
                 $this->connection['pass'],
@@ -101,21 +101,21 @@  discard block
 block discarded – undo
101 101
             ->addColumns(
102 102
                 $columns
103 103
                     ->clone()
104
-                    ->mapKey(function ($v) { return $v['Field']; })
104
+                    ->mapKey(function($v) { return $v['Field']; })
105 105
                     ->toArray()
106 106
             )
107 107
             ->setPrimaryKey(
108 108
                 $columns
109 109
                     ->clone()
110
-                    ->filter(function ($v) { return $v['Key'] === 'PRI'; })
110
+                    ->filter(function($v) { return $v['Key'] === 'PRI'; })
111 111
                     ->pluck('Field')
112 112
                     ->toArray()
113 113
             )
114 114
             ->setComment(
115
-                (string)Collection::from($this
115
+                (string) Collection::from($this
116 116
                     ->query(
117 117
                         "SELECT table_comment FROM information_schema.tables WHERE table_schema = ? AND table_name = ?",
118
-                        [ $this->connection['name'], $table ]
118
+                        [$this->connection['name'], $table]
119 119
                     ))
120 120
                     ->pluck('table_comment')
121 121
                     ->value()
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                         "SELECT TABLE_NAME, COLUMN_NAME, CONSTRAINT_NAME, REFERENCED_COLUMN_NAME
133 133
                          FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
134 134
                          WHERE TABLE_SCHEMA = ? AND REFERENCED_TABLE_SCHEMA = ? AND REFERENCED_TABLE_NAME = ?",
135
-                        [ $this->connection['name'], $this->connection['name'], $table ]
135
+                        [$this->connection['name'], $this->connection['name'], $table]
136 136
                     ) as $relation
137 137
             ) {
138 138
                 $relations[$relation['CONSTRAINT_NAME']]['table'] = $relation['TABLE_NAME'];
@@ -158,9 +158,9 @@  discard block
 block discarded – undo
158 158
                              WHERE
159 159
                                  TABLE_SCHEMA = ? AND TABLE_NAME = ? AND COLUMN_NAME IN (??) AND
160 160
                                  REFERENCED_TABLE_NAME IS NOT NULL",
161
-                            [ $this->connection['name'], $data['table'], $columns ]
161
+                            [$this->connection['name'], $data['table'], $columns]
162 162
                         ))
163
-                        ->map(function ($v) {
163
+                        ->map(function($v) {
164 164
                             $new = [];
165 165
                             foreach ($v as $kk => $vv) {
166 166
                                 $new[strtoupper($kk)] = $vv;
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
                     $relname = $foreign['table'];
179 179
                     $cntr = 1;
180 180
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
181
-                        $relname = $foreign['table'] . '_' . (++ $cntr);
181
+                        $relname = $foreign['table'].'_'.(++$cntr);
182 182
                     }
183 183
                     $definition->addRelation(
184 184
                         new TableRelation(
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
                     $relname = $data['table'];
195 195
                     $cntr = 1;
196 196
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
197
-                        $relname = $data['table'] . '_' . (++ $cntr);
197
+                        $relname = $data['table'].'_'.(++$cntr);
198 198
                     }
199 199
                     $definition->addRelation(
200 200
                         new TableRelation(
@@ -215,9 +215,9 @@  discard block
 block discarded – undo
215 215
                     "SELECT TABLE_NAME, COLUMN_NAME, CONSTRAINT_NAME, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME
216 216
                      FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
217 217
                      WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ? AND REFERENCED_TABLE_NAME IS NOT NULL",
218
-                    [ $this->connection['name'], $table ]
218
+                    [$this->connection['name'], $table]
219 219
                 ))
220
-                ->map(function ($v) {
220
+                ->map(function($v) {
221 221
                     $new = [];
222 222
                     foreach ($v as $kk => $vv) {
223 223
                         $new[strtoupper($kk)] = $vv;
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
                 $relname = $data['table'];
233 233
                 $cntr = 1;
234 234
                 while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
235
-                    $relname = $data['table'] . '_' . (++ $cntr);
235
+                    $relname = $data['table'].'_'.(++$cntr);
236 236
                 }
237 237
                 $definition->addRelation(
238 238
                     new TableRelation(
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
                 "SELECT table_name FROM information_schema.tables where table_schema = ?",
254 254
                 [$this->connection['name']]
255 255
             ))
256
-            ->map(function ($v) {
256
+            ->map(function($v) {
257 257
                 $new = [];
258 258
                 foreach ($v as $kk => $vv) {
259 259
                     $new[strtoupper($kk)] = $vv;
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
                 return $new;
262 262
             })
263 263
             ->pluck('TABLE_NAME')
264
-            ->map(function ($v) {
264
+            ->map(function($v) {
265 265
                 return $this->table($v);
266 266
             })
267 267
             ->toArray();
Please login to merge, or discard this patch.