Completed
Push — master ( 036ee8...c67404 )
by Ivan
03:01
created
src/schema/Table.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     public function setPrimaryKey($column) : Table
79 79
     {
80 80
         if (!is_array($column)) {
81
-            $column = [ $column ];
81
+            $column = [$column];
82 82
         }
83 83
         $this->data['primary'] = $column;
84 84
         return $this;
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         }
166 166
 
167 167
         if (!isset($name)) {
168
-            $name = $toTable->getName() . '_' . implode('_', array_keys($keymap));
168
+            $name = $toTable->getName().'_'.implode('_', array_keys($keymap));
169 169
         }
170 170
         $this->addRelation(new TableRelation(
171 171
             $name,
Please login to merge, or discard this patch.
src/driver/mysql/Statement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
             }
84 84
         }
85 85
         if (!$this->statement->execute()) {
86
-            throw new DBException('Prepared execute error: ' . $this->statement->error);
86
+            throw new DBException('Prepared execute error: '.$this->statement->error);
87 87
         }
88 88
         return new Result($this->statement);
89 89
     }
Please login to merge, or discard this patch.
src/driver/odbc/Result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
74 74
     }
75 75
     public function next()
76 76
     {
77
-        $this->fetched ++;
77
+        $this->fetched++;
78 78
         $temp = \odbc_fetch_row($this->statement);
79 79
         if (!$temp) {
80 80
             $this->last = false;
Please login to merge, or discard this patch.
src/schema/TableQueryIterator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                 $fields = [];
71 71
                 $exists = false;
72 72
                 foreach ($relation->table->getColumns() as $column) {
73
-                    $nm = $name . static::SEP . $column;
73
+                    $nm = $name.static::SEP.$column;
74 74
                     if (isset($this->aliases[$nm])) {
75 75
                         $nm = $this->aliases[$nm];
76 76
                     }
@@ -84,16 +84,16 @@  discard block
 block discarded – undo
84 84
                 $parts = explode(static::SEP, $name);
85 85
                 $name  = array_pop($parts);
86 86
                 if (!$exists && !count($parts) && !isset($temp[$name])) {
87
-                    $temp[$name] = $relation->many ? [ '___clean' => true ] : null;
87
+                    $temp[$name] = $relation->many ? ['___clean' => true] : null;
88 88
                 }
89 89
                 if ($exists) {
90
-                    $full  = '';
90
+                    $full = '';
91 91
                     foreach ($parts as $item) {
92
-                        $full = $full ? $full . static::SEP . $item : $item;
92
+                        $full = $full ? $full.static::SEP.$item : $item;
93 93
                         $temp = &$temp[$item];
94 94
                         $rpk = [];
95 95
                         foreach ($this->relations[$full][0]->table->getPrimaryKey() as $pkey) {
96
-                            $nm = $full . static::SEP . $pkey;
96
+                            $nm = $full.static::SEP.$pkey;
97 97
                             if (isset($this->aliases[$nm])) {
98 98
                                 $nm = $this->aliases[$nm];
99 99
                             }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                         $temp = &$temp[json_encode($rpk)];
103 103
                     }
104 104
                     if (!isset($temp[$name])) {
105
-                        $temp[$name] = $relation->many ? [ '___clean' => true ] : null;
105
+                        $temp[$name] = $relation->many ? ['___clean' => true] : null;
106 106
                     }
107 107
                     $temp = &$temp[$name];
108 108
                     if ($relation->many) {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                 return;
161 161
             }
162 162
         }
163
-        $this->fetched ++;
163
+        $this->fetched++;
164 164
         while ($this->result->valid()) {
165 165
             $row = $this->result->current();
166 166
             $pk = [];
Please login to merge, or discard this patch.
src/schema/TableColumn.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
             $instance->setLength($data['length']);
52 52
         }
53 53
         if ($instance->getBasicType() === 'enum' && strpos($instance->getType(), 'enum(') === 0) {
54
-            $temp = array_map(function ($v) {
54
+            $temp = array_map(function($v) {
55 55
                 return str_replace("''", "'", $v);
56 56
             }, explode("','", substr($instance->getType(), 6, -2)));
57 57
             $instance->setValues($temp);
Please login to merge, or discard this patch.
src/driver/mysql/Driver.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     {
36 36
         if ($this->lnk === null) {
37 37
             $this->lnk = new \mysqli(
38
-                (isset($this->connection['opts']['persist']) && $this->connection['opts']['persist'] ? 'p:' : '') .
38
+                (isset($this->connection['opts']['persist']) && $this->connection['opts']['persist'] ? 'p:' : '').
39 39
                     $this->connection['host'],
40 40
                 $this->connection['user'],
41 41
                 $this->connection['pass'],
@@ -111,10 +111,10 @@  discard block
 block discarded – undo
111 111
             $comments = Collection::from(
112 112
                 $this->query(
113 113
                     "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ?",
114
-                    [ $this->connection['name'] ]
114
+                    [$this->connection['name']]
115 115
                 )
116 116
             )
117
-            ->mapKey(function ($v) {
117
+            ->mapKey(function($v) {
118 118
                 return $v['TABLE_NAME'];
119 119
             })
120 120
             ->pluck('TABLE_COMMENT')
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
                      WHERE
134 134
                         TABLE_SCHEMA = ? AND TABLE_NAME IS NOT NULL AND
135 135
                         REFERENCED_TABLE_SCHEMA = ? AND REFERENCED_TABLE_NAME IS NOT NULL",
136
-                    [ $this->connection['name'], $this->connection['name'] ]
136
+                    [$this->connection['name'], $this->connection['name']]
137 137
                 )
138 138
             )->toArray();
139 139
             foreach ($col as $row) {
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
             ->addColumns(
152 152
                 $columns
153 153
                     ->clone()
154
-                    ->mapKey(function ($v) { return $v['Field']; })
155
-                    ->map(function ($v) {
154
+                    ->mapKey(function($v) { return $v['Field']; })
155
+                    ->map(function($v) {
156 156
                         $v['length'] = null;
157 157
                         if (!isset($v['Type'])) {
158 158
                             return $v;
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                             default:
175 175
                                 if (strpos($type, 'char') !== false && strpos($type, '(') !== false) {
176 176
                                     // extract length from varchar
177
-                                    $v['length'] = (int)explode(')', explode('(', $type)[1])[0];
177
+                                    $v['length'] = (int) explode(')', explode('(', $type)[1])[0];
178 178
                                     $v['length'] = $v['length'] > 0 ? $v['length'] : null;
179 179
                                 }
180 180
                                 break;
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
             ->setPrimaryKey(
187 187
                 $columns
188 188
                     ->clone()
189
-                    ->filter(function ($v) { return $v['Key'] === 'PRI'; })
189
+                    ->filter(function($v) { return $v['Key'] === 'PRI'; })
190 190
                     ->pluck('Field')
191 191
                     ->toArray()
192 192
             )
@@ -213,10 +213,10 @@  discard block
 block discarded – undo
213 213
                 $usedcol = [];
214 214
                 if (count($columns)) {
215 215
                     foreach (Collection::from($relationsT[$data['table']] ?? [])
216
-                        ->filter(function ($v) use ($columns) {
216
+                        ->filter(function($v) use ($columns) {
217 217
                             return in_array($v['COLUMN_NAME'], $columns);
218 218
                         })
219
-                        ->map(function ($v) {
219
+                        ->map(function($v) {
220 220
                             $new = [];
221 221
                             foreach ($v as $kk => $vv) {
222 222
                                 $new[strtoupper($kk)] = $vv;
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
                     $relname = $foreign['table'];
235 235
                     $cntr = 1;
236 236
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
237
-                        $relname = $foreign['table'] . '_' . (++ $cntr);
237
+                        $relname = $foreign['table'].'_'.(++$cntr);
238 238
                     }
239 239
                     $definition->addRelation(
240 240
                         new TableRelation(
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
                     $relname = $data['table'];
251 251
                     $cntr = 1;
252 252
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
253
-                        $relname = $data['table'] . '_' . (++ $cntr);
253
+                        $relname = $data['table'].'_'.(++$cntr);
254 254
                     }
255 255
                     $definition->addRelation(
256 256
                         new TableRelation(
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
             // resulting in a "belongsTo" relationship
268 268
             $relations = [];
269 269
             foreach (Collection::from($relationsT[$table] ?? [])
270
-                ->map(function ($v) {
270
+                ->map(function($v) {
271 271
                     $new = [];
272 272
                     foreach ($v as $kk => $vv) {
273 273
                         $new[strtoupper($kk)] = $vv;
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
                 $relname = $data['table'];
283 283
                 $cntr = 1;
284 284
                 while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
285
-                    $relname = $data['table'] . '_' . (++ $cntr);
285
+                    $relname = $data['table'].'_'.(++$cntr);
286 286
                 }
287 287
                 $definition->addRelation(
288 288
                     new TableRelation(
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
                 "SELECT table_name FROM information_schema.tables where table_schema = ?",
304 304
                 [$this->connection['name']]
305 305
             ))
306
-            ->map(function ($v) {
306
+            ->map(function($v) {
307 307
                 $new = [];
308 308
                 foreach ($v as $kk => $vv) {
309 309
                     $new[strtoupper($kk)] = $vv;
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
                 return $new;
312 312
             })
313 313
             ->pluck('TABLE_NAME')
314
-            ->map(function ($v) {
314
+            ->map(function($v) {
315 315
                 return $this->table($v);
316 316
             })
317 317
             ->toArray();
Please login to merge, or discard this patch.
src/driver/oracle/Driver.php 1 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/pdo/Statement.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,28 +24,28 @@
 block discarded – undo
24 24
         foreach ($data as $i => $v) {
25 25
             switch (gettype($v)) {
26 26
                 case 'boolean':
27
-                    $this->statement->bindValue($i+1, $v, \PDO::PARAM_BOOL);
27
+                    $this->statement->bindValue($i + 1, $v, \PDO::PARAM_BOOL);
28 28
                     break;
29 29
                 case 'integer':
30
-                    $this->statement->bindValue($i+1, $v, \PDO::PARAM_INT);
30
+                    $this->statement->bindValue($i + 1, $v, \PDO::PARAM_INT);
31 31
                     break;
32 32
                 case 'NULL':
33
-                    $this->statement->bindValue($i+1, $v, \PDO::PARAM_NULL);
33
+                    $this->statement->bindValue($i + 1, $v, \PDO::PARAM_NULL);
34 34
                     break;
35 35
                 case 'double':
36
-                    $this->statement->bindValue($i+1, $v);
36
+                    $this->statement->bindValue($i + 1, $v);
37 37
                     break;
38 38
                 default:
39 39
                     // keep in mind oracle needs a transaction when inserting LOBs, aside from the specific syntax:
40 40
                     // INSERT INTO table (column, lobcolumn) VALUES (?, ?, EMPTY_BLOB()) RETURNING lobcolumn INTO ?
41 41
                     if (is_resource($v) && get_resource_type($v) === 'stream') {
42
-                        $this->statement->bindParam($i+1, $v, \PDO::PARAM_LOB);
42
+                        $this->statement->bindParam($i + 1, $v, \PDO::PARAM_LOB);
43 43
                         break;
44 44
                     }
45 45
                     if (!is_string($data[$i])) {
46 46
                         $data[$i] = serialize($data[$i]);
47 47
                     }
48
-                    $this->statement->bindValue($i+1, $v);
48
+                    $this->statement->bindValue($i + 1, $v);
49 49
                     break;
50 50
             }
51 51
         }
Please login to merge, or discard this patch.
src/driver/postgre/Driver.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.