Completed
Push — master ( e4d56c...8e58c0 )
by Ivan
02:47
created
src/driver/odbc/Result.php 2 patches
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.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -18,6 +18,9 @@
 block discarded – undo
18 18
     protected $fetched = -1;
19 19
     protected $iid = null;
20 20
 
21
+    /**
22
+     * @param resource $statement
23
+     */
21 24
     public function __construct($statement, $data, $iid, $charIn = null, $charOut = null)
22 25
     {
23 26
         $this->statement = $statement;
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/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/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/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/oracle/Schema.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@
 block discarded – undo
124 124
                     }
125 125
                     return $new;
126 126
                 })
127
-                 as $relation
127
+                    as $relation
128 128
             ) {
129 129
                 $relations[$relation['CONSTRAINT_NAME']]['table'] = $relation['TABLE_NAME'];
130 130
                 $relations[$relation['CONSTRAINT_NAME']]['keymap'][$primary[(int)$relation['POSITION']-1]] =
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -29,19 +29,19 @@  discard block
 block discarded – undo
29 29
         $columns = Collection::from($this
30 30
             ->query(
31 31
                 "SELECT * FROM all_tab_cols WHERE table_name = ? AND owner = ?",
32
-                [ strtoupper($table), $this->name() ]
32
+                [strtoupper($table), $this->name()]
33 33
             ))
34
-            ->map(function ($v) {
34
+            ->map(function($v) {
35 35
                 $new = [];
36 36
                 foreach ($v as $kk => $vv) {
37 37
                     $new[strtoupper($kk)] = $vv;
38 38
                 }
39 39
                 return $new;
40 40
             })
41
-            ->mapKey(function ($v) {
41
+            ->mapKey(function($v) {
42 42
                 return $v['COLUMN_NAME'];
43 43
             })
44
-            ->map(function ($v) {
44
+            ->map(function($v) {
45 45
                 $v['length'] = null;
46 46
                 if (!isset($v['DATA_TYPE'])) {
47 47
                     return $v;
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
                     default:
54 54
                         if (strpos($type, 'char') !== false && strpos($type, '(') !== false) {
55 55
                             // extract length from varchar
56
-                            $v['length'] = (int)explode(')', (explode('(', $type)[1] ?? ''))[0];
56
+                            $v['length'] = (int) explode(')', (explode('(', $type)[1] ?? ''))[0];
57 57
                             $v['length'] = $v['length'] > 0 ? $v['length'] : null;
58 58
                         }
59 59
                         break;
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
             ->query(
70 70
                 "SELECT constraint_name FROM all_constraints
71 71
                 WHERE table_name = ? AND constraint_type = ? AND owner = ?",
72
-                [ strtoupper($table), 'P', $owner ]
72
+                [strtoupper($table), 'P', $owner]
73 73
             ))
74
-            ->map(function ($v) {
74
+            ->map(function($v) {
75 75
                 $new = [];
76 76
                 foreach ($v as $kk => $vv) {
77 77
                     $new[strtoupper($kk)] = $vv;
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
                 ->query(
87 87
                     "SELECT column_name FROM all_cons_columns
88 88
                     WHERE table_name = ? AND constraint_name = ? AND owner = ?",
89
-                    [ strtoupper($table), $pkname, $owner ]
89
+                    [strtoupper($table), $pkname, $owner]
90 90
                 ))
91
-                ->map(function ($v) {
91
+                ->map(function($v) {
92 92
                     $new = [];
93 93
                     foreach ($v as $kk => $vv) {
94 94
                         $new[strtoupper($kk)] = $vv;
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
                     LEFT JOIN all_cons_columns cc ON cc.OWNER = ac.OWNER AND cc.CONSTRAINT_NAME = ac.CONSTRAINT_NAME
116 116
                     WHERE ac.OWNER = ? AND ac.R_OWNER = ? AND ac.R_CONSTRAINT_NAME = ? AND ac.CONSTRAINT_TYPE = ?
117 117
                     ORDER BY cc.POSITION",
118
-                    [ $owner, $owner, $pkname, 'R' ]
118
+                    [$owner, $owner, $pkname, 'R']
119 119
                 ))
120
-                ->map(function ($v) {
120
+                ->map(function($v) {
121 121
                     $new = [];
122 122
                     foreach ($v as $kk => $vv) {
123 123
                         $new[strtoupper($kk)] = $vv;
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                  as $relation
128 128
             ) {
129 129
                 $relations[$relation['CONSTRAINT_NAME']]['table'] = $relation['TABLE_NAME'];
130
-                $relations[$relation['CONSTRAINT_NAME']]['keymap'][$primary[(int)$relation['POSITION']-1]] =
130
+                $relations[$relation['CONSTRAINT_NAME']]['keymap'][$primary[(int) $relation['POSITION'] - 1]] =
131 131
                     $relation['COLUMN_NAME'];
132 132
             }
133 133
             foreach ($relations as $data) {
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
                                 ac.OWNER = ? AND ac.R_OWNER = ? AND ac.TABLE_NAME = ? AND ac.CONSTRAINT_TYPE = ? AND
158 158
                                 cc.COLUMN_NAME IN (??)
159 159
                             ORDER BY POSITION",
160
-                            [ $owner, $owner, $data['table'], 'R', $columns ]
160
+                            [$owner, $owner, $data['table'], 'R', $columns]
161 161
                         ))
162
-                        ->map(function ($v) {
162
+                        ->map(function($v) {
163 163
                             $new = [];
164 164
                             foreach ($v as $kk => $vv) {
165 165
                                 $new[strtoupper($kk)] = $vv;
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
                         ->query(
180 180
                             "SELECT COLUMN_NAME FROM all_cons_columns
181 181
                              WHERE OWNER = ? AND CONSTRAINT_NAME = ? ORDER BY POSITION",
182
-                            [ $owner, current($foreign['keymap']) ]
182
+                            [$owner, current($foreign['keymap'])]
183 183
                         ))
184
-                        ->map(function ($v) {
184
+                        ->map(function($v) {
185 185
                             $new = [];
186 186
                             foreach ($v as $kk => $vv) {
187 187
                                 $new[strtoupper($kk)] = $vv;
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
                     $relname = $foreign['table'];
197 197
                     $cntr = 1;
198 198
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
199
-                        $relname = $foreign['table'] . '_' . (++ $cntr);
199
+                        $relname = $foreign['table'].'_'.(++$cntr);
200 200
                     }
201 201
                     $definition->addRelation(
202 202
                         new TableRelation(
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
                     $relname = $data['table'];
213 213
                     $cntr = 1;
214 214
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
215
-                        $relname = $data['table'] . '_' . (++ $cntr);
215
+                        $relname = $data['table'].'_'.(++$cntr);
216 216
                     }
217 217
                     $definition->addRelation(
218 218
                         new TableRelation(
@@ -240,9 +240,9 @@  discard block
 block discarded – undo
240 240
                     LEFT JOIN all_cons_columns cc ON cc.OWNER = ac.OWNER AND cc.CONSTRAINT_NAME = ac.CONSTRAINT_NAME
241 241
                     WHERE ac.OWNER = ? AND ac.R_OWNER = ? AND ac.TABLE_NAME = ? AND ac.CONSTRAINT_TYPE = ?
242 242
                     ORDER BY cc.POSITION",
243
-                    [ $owner, $owner, strtoupper($table), 'R' ]
243
+                    [$owner, $owner, strtoupper($table), 'R']
244 244
                 ))
245
-                ->map(function ($v) {
245
+                ->map(function($v) {
246 246
                     $new = [];
247 247
                     foreach ($v as $kk => $vv) {
248 248
                         $new[strtoupper($kk)] = $vv;
@@ -260,9 +260,9 @@  discard block
 block discarded – undo
260 260
                     ->query(
261 261
                         "SELECT COLUMN_NAME FROM all_cons_columns
262 262
                          WHERE OWNER = ? AND CONSTRAINT_NAME = ? ORDER BY POSITION",
263
-                        [ $owner, current($data['keymap']) ]
263
+                        [$owner, current($data['keymap'])]
264 264
                     ))
265
-                    ->map(function ($v) {
265
+                    ->map(function($v) {
266 266
                         $new = [];
267 267
                         foreach ($v as $kk => $vv) {
268 268
                             $new[strtoupper($kk)] = $vv;
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
                 $relname = $data['table'];
278 278
                 $cntr = 1;
279 279
                 while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
280
-                    $relname = $data['table'] . '_' . (++ $cntr);
280
+                    $relname = $data['table'].'_'.(++$cntr);
281 281
                 }
282 282
                 $definition->addRelation(
283 283
                     new TableRelation(
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
                 "SELECT TABLE_NAME FROM ALL_TABLES where OWNER = ?",
299 299
                 [$this->connection['name']]
300 300
             ))
301
-            ->map(function ($v) {
301
+            ->map(function($v) {
302 302
                 $new = [];
303 303
                 foreach ($v as $kk => $vv) {
304 304
                     $new[strtoupper($kk)] = $vv;
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
                 return $new;
307 307
             })
308 308
             ->pluck('TABLE_NAME')
309
-            ->map(function ($v) {
309
+            ->map(function($v) {
310 310
                 return $this->table($v);
311 311
             })
312 312
             ->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
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
                         kc.table_schema = ? AND
48 48
                         kc.table_name IS NOT NULL AND
49 49
                         kc.position_in_unique_constraint IS NOT NULL",
50
-                    [ $this->connection['opts']['schema'] ?? $this->connection['name'] ]
50
+                    [$this->connection['opts']['schema'] ?? $this->connection['name']]
51 51
                 )
52 52
             )->toArray();
53 53
             foreach ($col as $row) {
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
         $columns = Collection::from($this
60 60
             ->query(
61 61
                 "SELECT * FROM information_schema.columns WHERE table_name = ? AND table_schema = ?",
62
-                [ $table, $this->connection['opts']['schema'] ?? $this->connection['name'] ]
62
+                [$table, $this->connection['opts']['schema'] ?? $this->connection['name']]
63 63
             ))
64
-            ->mapKey(function ($v) {
64
+            ->mapKey(function($v) {
65 65
                 return $v['column_name'];
66 66
             })
67
-            ->map(function ($v) {
67
+            ->map(function($v) {
68 68
                 $v['length'] = null;
69 69
                 if (!isset($v['data_type'])) {
70 70
                     return $v;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                 switch ($v['data_type']) {
73 73
                     case 'character':
74 74
                     case 'character varying':
75
-                        $v['length'] = (int)$v['character_maximum_length'];
75
+                        $v['length'] = (int) $v['character_maximum_length'];
76 76
                         break;
77 77
                 }
78 78
                 return $v;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             ->query(
86 86
                 "SELECT constraint_name FROM information_schema.table_constraints
87 87
                 WHERE table_name = ? AND constraint_type = ? AND table_schema = ?",
88
-                [ $table, 'PRIMARY KEY', $this->connection['opts']['schema'] ?? $this->connection['name'] ]
88
+                [$table, 'PRIMARY KEY', $this->connection['opts']['schema'] ?? $this->connection['name']]
89 89
             ))
90 90
             ->pluck('constraint_name')
91 91
             ->value();
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                 ->query(
96 96
                     "SELECT column_name FROM information_schema.constraint_column_usage
97 97
                      WHERE table_name = ? AND constraint_name = ? AND table_schema = ?",
98
-                    [ $table, $pkname, $this->connection['opts']['schema'] ?? $this->connection['name'] ]
98
+                    [$table, $pkname, $this->connection['opts']['schema'] ?? $this->connection['name']]
99 99
                 ))
100 100
                 ->pluck('column_name')
101 101
                 ->toArray();
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                 $usedcol = [];
128 128
                 if (count($columns)) {
129 129
                     foreach (Collection::from($relationsT[$data['table']] ?? [])
130
-                        ->filter(function ($v) use ($columns) {
130
+                        ->filter(function($v) use ($columns) {
131 131
                             return in_array($v['column_name'], $columns);
132 132
                         }) as $relation
133 133
                     ) {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
                     $relname = $foreign['table'];
143 143
                     $cntr = 1;
144 144
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
145
-                        $relname = $foreign['table'] . '_' . (++ $cntr);
145
+                        $relname = $foreign['table'].'_'.(++$cntr);
146 146
                     }
147 147
                     $definition->addRelation(
148 148
                         new TableRelation(
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                     $relname = $data['table'];
159 159
                     $cntr = 1;
160 160
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
161
-                        $relname = $data['table'] . '_' . (++ $cntr);
161
+                        $relname = $data['table'].'_'.(++$cntr);
162 162
                     }
163 163
                     $definition->addRelation(
164 164
                         new TableRelation(
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                 $relname = $data['table'];
184 184
                 $cntr = 1;
185 185
                 while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
186
-                    $relname = $data['table'] . '_' . (++ $cntr);
186
+                    $relname = $data['table'].'_'.(++$cntr);
187 187
                 }
188 188
                 $definition->addRelation(
189 189
                     new TableRelation(
@@ -202,10 +202,10 @@  discard block
 block discarded – undo
202 202
         return Collection::from($this
203 203
             ->query(
204 204
                 "SELECT table_name FROM information_schema.tables where table_schema = ?",
205
-                [ $this->connection['opts']['schema'] ?? $this->connection['name'] ]
205
+                [$this->connection['opts']['schema'] ?? $this->connection['name']]
206 206
             ))
207 207
             ->pluck('table_name')
208
-            ->map(function ($v) {
208
+            ->map(function($v) {
209 209
                 return $this->table($v);
210 210
             })
211 211
             ->toArray();
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
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
             $comments = Collection::from(
29 29
                 $this->query(
30 30
                     "SELECT TABLE_NAME, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ?",
31
-                    [ $this->connection['opts']['schema'] ?? $this->connection['name'] ]
31
+                    [$this->connection['opts']['schema'] ?? $this->connection['name']]
32 32
                 )
33 33
             )
34
-            ->mapKey(function ($v) {
34
+            ->mapKey(function($v) {
35 35
                 return $v['TABLE_NAME'];
36 36
             })
37 37
             ->pluck('TABLE_COMMENT')
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
             ->addColumns(
72 72
                 $columns
73 73
                     ->clone()
74
-                    ->mapKey(function ($v) {
74
+                    ->mapKey(function($v) {
75 75
                         return $v['Field'];
76 76
                     })
77
-                    ->map(function ($v) {
77
+                    ->map(function($v) {
78 78
                         $v['length'] = null;
79 79
                         if (!isset($v['Type'])) {
80 80
                             return $v;
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                             default:
97 97
                                 if (strpos($type, 'char') !== false && strpos($type, '(') !== false) {
98 98
                                     // extract length from varchar
99
-                                    $v['length'] = (int)explode(')', explode('(', $type)[1])[0];
99
+                                    $v['length'] = (int) explode(')', explode('(', $type)[1])[0];
100 100
                                     $v['length'] = $v['length'] > 0 ? $v['length'] : null;
101 101
                                 }
102 102
                                 break;
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             ->setPrimaryKey(
109 109
                 $columns
110 110
                     ->clone()
111
-                    ->filter(function ($v) {
111
+                    ->filter(function($v) {
112 112
                         return $v['Key'] === 'PRI';
113 113
                     })
114 114
                     ->pluck('Field')
@@ -138,10 +138,10 @@  discard block
 block discarded – undo
138 138
                 $usedcol = [];
139 139
                 if (count($columns)) {
140 140
                     foreach (Collection::from($relationsT[$data['table']] ?? [])
141
-                        ->filter(function ($v) use ($columns) {
141
+                        ->filter(function($v) use ($columns) {
142 142
                             return in_array($v['COLUMN_NAME'], $columns);
143 143
                         })
144
-                        ->map(function ($v) {
144
+                        ->map(function($v) {
145 145
                             $new = [];
146 146
                             foreach ($v as $kk => $vv) {
147 147
                                 $new[strtoupper($kk)] = $vv;
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                     $relname = $foreign['table'];
161 161
                     $cntr = 1;
162 162
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
163
-                        $relname = $foreign['table'] . '_' . (++ $cntr);
163
+                        $relname = $foreign['table'].'_'.(++$cntr);
164 164
                     }
165 165
                     $definition->addRelation(
166 166
                         new TableRelation(
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                     $relname = $data['table'];
177 177
                     $cntr = 1;
178 178
                     while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
179
-                        $relname = $data['table'] . '_' . (++ $cntr);
179
+                        $relname = $data['table'].'_'.(++$cntr);
180 180
                     }
181 181
                     $definition->addRelation(
182 182
                         new TableRelation(
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
             // resulting in a "belongsTo" relationship
194 194
             $relations = [];
195 195
             foreach (Collection::from($relationsT[$table] ?? [])
196
-                ->map(function ($v) {
196
+                ->map(function($v) {
197 197
                     $new = [];
198 198
                     foreach ($v as $kk => $vv) {
199 199
                         $new[strtoupper($kk)] = $vv;
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
                 $relname = $data['table'];
210 210
                 $cntr = 1;
211 211
                 while ($definition->hasRelation($relname) || $definition->getName() == $relname) {
212
-                    $relname = $data['table'] . '_' . (++ $cntr);
212
+                    $relname = $data['table'].'_'.(++$cntr);
213 213
                 }
214 214
                 $definition->addRelation(
215 215
                     new TableRelation(
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
                 "SELECT table_name FROM information_schema.tables where table_schema = ?",
231 231
                 [$this->connection['opts']['schema'] ?? $this->connection['name']]
232 232
             ))
233
-            ->map(function ($v) {
233
+            ->map(function($v) {
234 234
                 $new = [];
235 235
                 foreach ($v as $kk => $vv) {
236 236
                     $new[strtoupper($kk)] = $vv;
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
                 return $new;
239 239
             })
240 240
             ->pluck('TABLE_NAME')
241
-            ->map(function ($v) {
241
+            ->map(function($v) {
242 242
                 return $this->table($v);
243 243
             })
244 244
             ->toArray();
Please login to merge, or discard this patch.