Completed
Push — master ( 1ba1d1...f06abd )
by Ivan
03:09
created
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.