Completed
Push — master ( 407844...9daecf )
by Ivan
02:25
created
src/driver/oracle/Driver.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 
91 91
     public function begin() : bool
92 92
     {
93
-         return $this->transaction = true;
93
+            return $this->transaction = true;
94 94
     }
95 95
     public function commit() : bool
96 96
     {
Please login to merge, or discard this patch.
src/driver/oracle/Schema.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@
 block discarded – undo
118 118
                     }
119 119
                     return $new;
120 120
                 })
121
-                 as $relation
121
+                    as $relation
122 122
             ) {
123 123
                 $relations[$relation['CONSTRAINT_NAME']]['table'] = $relation['TABLE_NAME'];
124 124
                 $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/postgre/Schema.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                      JOIN information_schema.constraint_table_usage ct ON kc.constraint_name = ct.constraint_name AND ct.table_schema = kc.table_schema
148 148
                      WHERE
149 149
                         kc.table_schema = ? AND kc.table_name IS NOT NULL AND kc.position_in_unique_constraint IS NOT NULL",
150
-                    [ $this->connection['opts']['schema'] ?? $this->connection['name'] ]
150
+                    [$this->connection['opts']['schema'] ?? $this->connection['name']]
151 151
                 )
152 152
             )->toArray();
153 153
             foreach ($col as $row) {
@@ -159,10 +159,10 @@  discard block
 block discarded – undo
159 159
         $columns = Collection::from($this
160 160
             ->query(
161 161
                 "SELECT * FROM information_schema.columns WHERE table_name = ? AND table_schema = ?",
162
-                [ $table, $this->connection['opts']['schema'] ?? $this->connection['name'] ]
162
+                [$table, $this->connection['opts']['schema'] ?? $this->connection['name']]
163 163
             ))
164
-            ->mapKey(function ($v) { return $v['column_name']; })
165
-            ->map(function ($v) {
164
+            ->mapKey(function($v) { return $v['column_name']; })
165
+            ->map(function($v) {
166 166
                 $v['length'] = null;
167 167
                 if (!isset($v['data_type'])) {
168 168
                     return $v;
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
                 switch ($v['data_type']) {
171 171
                     case 'character':
172 172
                     case 'character varying':
173
-                        $v['length'] = (int)$v['character_maximum_length'];
173
+                        $v['length'] = (int) $v['character_maximum_length'];
174 174
                         break;
175 175
                 }
176 176
                 return $v;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
             ->query(
184 184
                 "SELECT constraint_name FROM information_schema.table_constraints
185 185
                 WHERE table_name = ? AND constraint_type = ? AND table_schema = ?",
186
-                [ $table, 'PRIMARY KEY', $this->connection['opts']['schema'] ?? $this->connection['name'] ]
186
+                [$table, 'PRIMARY KEY', $this->connection['opts']['schema'] ?? $this->connection['name']]
187 187
             ))
188 188
             ->pluck('constraint_name')
189 189
             ->value();
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                 ->query(
194 194
                     "SELECT column_name FROM information_schema.constraint_column_usage
195 195
                      WHERE table_name = ? AND constraint_name = ? AND table_schema = ?",
196
-                    [ $table, $pkname, $this->connection['opts']['schema'] ?? $this->connection['name'] ]
196
+                    [$table, $pkname, $this->connection['opts']['schema'] ?? $this->connection['name']]
197 197
                 ))
198 198
                 ->pluck('column_name')
199 199
                 ->toArray();
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                 $usedcol = [];
225 225
                 if (count($columns)) {
226 226
                     foreach (Collection::from($relationsT[$data['table']] ?? [])
227
-                        ->filter(function ($v) use ($columns) {
227
+                        ->filter(function($v) use ($columns) {
228 228
                             return in_array($v['column_name'], $columns);
229 229
                         }) as $relation
230 230
                     ) {
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
                     $relname = $foreign['table'];
239 239
                     $cntr = 1;
240 240
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
241
-                        $relname = $foreign['table'] . '_' . (++ $cntr);
241
+                        $relname = $foreign['table'].'_'.(++$cntr);
242 242
                     }
243 243
                     $definition->addRelation(
244 244
                         new TableRelation(
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                     $relname = $data['table'];
255 255
                     $cntr = 1;
256 256
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
257
-                        $relname = $data['table'] . '_' . (++ $cntr);
257
+                        $relname = $data['table'].'_'.(++$cntr);
258 258
                     }
259 259
                     $definition->addRelation(
260 260
                         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(
@@ -297,10 +297,10 @@  discard block
 block discarded – undo
297 297
         return Collection::from($this
298 298
             ->query(
299 299
                 "SELECT table_name FROM information_schema.tables where table_schema = ?",
300
-                [ $this->connection['opts']['schema'] ?? $this->connection['name'] ]
300
+                [$this->connection['opts']['schema'] ?? $this->connection['name']]
301 301
             ))
302 302
             ->pluck('table_name')
303
-            ->map(function ($v) {
303
+            ->map(function($v) {
304 304
                 return $this->table($v);
305 305
             })
306 306
             ->toArray();
Please login to merge, or discard this patch.
src/driver/mysql/Driver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
     {
38 38
         if ($this->lnk === null) {
39 39
             $this->lnk = new \mysqli(
40
-                (isset($this->connection['opts']['persist']) && $this->connection['opts']['persist'] ? 'p:' : '') .
40
+                (isset($this->connection['opts']['persist']) && $this->connection['opts']['persist'] ? 'p:' : '').
41 41
                     $this->connection['host'],
42 42
                 $this->connection['user'],
43 43
                 $this->connection['pass'],
Please login to merge, or discard this patch.
src/driver/mysql/Schema.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
             $comments = Collection::from(
25 25
                 $this->query(
26 26
                     "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ?",
27
-                    [ $this->connection['opts']['schema'] ?? $this->connection['name'] ]
27
+                    [$this->connection['opts']['schema'] ?? $this->connection['name']]
28 28
                 )
29 29
             )
30
-            ->mapKey(function ($v) {
30
+            ->mapKey(function($v) {
31 31
                 return $v['TABLE_NAME'];
32 32
             })
33 33
             ->pluck('TABLE_COMMENT')
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
             ->addColumns(
68 68
                 $columns
69 69
                     ->clone()
70
-                    ->mapKey(function ($v) { return $v['Field']; })
71
-                    ->map(function ($v) {
70
+                    ->mapKey(function($v) { return $v['Field']; })
71
+                    ->map(function($v) {
72 72
                         $v['length'] = null;
73 73
                         if (!isset($v['Type'])) {
74 74
                             return $v;
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                             default:
91 91
                                 if (strpos($type, 'char') !== false && strpos($type, '(') !== false) {
92 92
                                     // extract length from varchar
93
-                                    $v['length'] = (int)explode(')', explode('(', $type)[1])[0];
93
+                                    $v['length'] = (int) explode(')', explode('(', $type)[1])[0];
94 94
                                     $v['length'] = $v['length'] > 0 ? $v['length'] : null;
95 95
                                 }
96 96
                                 break;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             ->setPrimaryKey(
103 103
                 $columns
104 104
                     ->clone()
105
-                    ->filter(function ($v) { return $v['Key'] === 'PRI'; })
105
+                    ->filter(function($v) { return $v['Key'] === 'PRI'; })
106 106
                     ->pluck('Field')
107 107
                     ->toArray()
108 108
             )
@@ -129,10 +129,10 @@  discard block
 block discarded – undo
129 129
                 $usedcol = [];
130 130
                 if (count($columns)) {
131 131
                     foreach (Collection::from($relationsT[$data['table']] ?? [])
132
-                        ->filter(function ($v) use ($columns) {
132
+                        ->filter(function($v) use ($columns) {
133 133
                             return in_array($v['COLUMN_NAME'], $columns);
134 134
                         })
135
-                        ->map(function ($v) {
135
+                        ->map(function($v) {
136 136
                             $new = [];
137 137
                             foreach ($v as $kk => $vv) {
138 138
                                 $new[strtoupper($kk)] = $vv;
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
                     $relname = $foreign['table'];
151 151
                     $cntr = 1;
152 152
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
153
-                        $relname = $foreign['table'] . '_' . (++ $cntr);
153
+                        $relname = $foreign['table'].'_'.(++$cntr);
154 154
                     }
155 155
                     $definition->addRelation(
156 156
                         new TableRelation(
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                     $relname = $data['table'];
167 167
                     $cntr = 1;
168 168
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
169
-                        $relname = $data['table'] . '_' . (++ $cntr);
169
+                        $relname = $data['table'].'_'.(++$cntr);
170 170
                     }
171 171
                     $definition->addRelation(
172 172
                         new TableRelation(
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
             // resulting in a "belongsTo" relationship
184 184
             $relations = [];
185 185
             foreach (Collection::from($relationsT[$table] ?? [])
186
-                ->map(function ($v) {
186
+                ->map(function($v) {
187 187
                     $new = [];
188 188
                     foreach ($v as $kk => $vv) {
189 189
                         $new[strtoupper($kk)] = $vv;
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
                 $relname = $data['table'];
199 199
                 $cntr = 1;
200 200
                 while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
201
-                    $relname = $data['table'] . '_' . (++ $cntr);
201
+                    $relname = $data['table'].'_'.(++$cntr);
202 202
                 }
203 203
                 $definition->addRelation(
204 204
                     new TableRelation(
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                 "SELECT table_name FROM information_schema.tables where table_schema = ?",
220 220
                 [$this->connection['opts']['schema'] ?? $this->connection['name']]
221 221
             ))
222
-            ->map(function ($v) {
222
+            ->map(function($v) {
223 223
                 $new = [];
224 224
                 foreach ($v as $kk => $vv) {
225 225
                     $new[strtoupper($kk)] = $vv;
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                 return $new;
228 228
             })
229 229
             ->pluck('TABLE_NAME')
230
-            ->map(function ($v) {
230
+            ->map(function($v) {
231 231
                 return $this->table($v);
232 232
             })
233 233
             ->toArray();
Please login to merge, or discard this patch.