| @@ -73,8 +73,7 @@ discard block | ||
| 73 | 73 | } | 
| 74 | 74 | $connection['name'] = $connectionString; | 
| 75 | 75 | $connection['type'] = isset($aliases[$connection['type']]) ? | 
| 76 | - $aliases[$connection['type']] : | |
| 77 | - $connection['type']; | |
| 76 | + $aliases[$connection['type']] : $connection['type']; | |
| 78 | 77 | $tmp = '\\vakata\\database\\driver\\'.strtolower($connection['type']).'\\Driver'; | 
| 79 | 78 | return new $tmp($connection); | 
| 80 | 79 | } | 
| @@ -94,7 +93,7 @@ discard block | ||
| 94 | 93 | $new = ''; | 
| 95 | 94 | $par = array_values($par); | 
| 96 | 95 |          if (substr_count($sql, '?') === 2 && !is_array($par[0])) { | 
| 97 | - $par = [ $par ]; | |
| 96 | + $par = [$par]; | |
| 98 | 97 | } | 
| 99 | 98 |          $parts = explode('??', $sql); | 
| 100 | 99 | $index = 0; | 
| @@ -104,7 +103,7 @@ discard block | ||
| 104 | 103 | $index += count($tmp) - 1; | 
| 105 | 104 |              if (isset($par[$index])) { | 
| 106 | 105 |                  if (!is_array($par[$index])) { | 
| 107 | - $par[$index] = [ $par[$index] ]; | |
| 106 | + $par[$index] = [$par[$index]]; | |
| 108 | 107 | } | 
| 109 | 108 | $params = $par[$index]; | 
| 110 | 109 | array_splice($par, $index, 1, $params); | 
| @@ -112,7 +111,7 @@ discard block | ||
| 112 | 111 |                  $new .= implode(',', array_fill(0, count($params), '?')); | 
| 113 | 112 | } | 
| 114 | 113 | } | 
| 115 | - return [ $new, $par ]; | |
| 114 | + return [$new, $par]; | |
| 116 | 115 | } | 
| 117 | 116 | /** | 
| 118 | 117 | * Run a query (prepare & execute). | 
| @@ -144,7 +143,7 @@ discard block | ||
| 144 | 143 |      { | 
| 145 | 144 | $coll = Collection::from($this->query($sql, $par)); | 
| 146 | 145 |          if (($keys = $this->driver->option('mode')) && in_array($keys, ['strtoupper', 'strtolower'])) { | 
| 147 | -            $coll->map(function ($v) use ($keys) { | |
| 146 | +            $coll->map(function($v) use ($keys) { | |
| 148 | 147 | $new = []; | 
| 149 | 148 |                  foreach ($v as $k => $vv) { | 
| 150 | 149 | $new[call_user_func($keys, $k)] = $vv; | 
| @@ -153,16 +152,16 @@ discard block | ||
| 153 | 152 | }); | 
| 154 | 153 | } | 
| 155 | 154 |          if ($key) { | 
| 156 | -            $coll->mapKey(function ($v) use ($key) { return $v[$key]; }); | |
| 155 | +            $coll->mapKey(function($v) use ($key) { return $v[$key]; }); | |
| 157 | 156 | } | 
| 158 | 157 |          if ($skip) { | 
| 159 | -            $coll->map(function ($v) use ($key) { unset($v[$key]); return $v; }); | |
| 158 | +            $coll->map(function($v) use ($key) { unset($v[$key]); return $v; }); | |
| 160 | 159 | } | 
| 161 | 160 |          if ($opti) { | 
| 162 | -            $coll->map(function ($v) { return count($v) === 1 ? current($v) : $v; }); | |
| 161 | +            $coll->map(function($v) { return count($v) === 1 ? current($v) : $v; }); | |
| 163 | 162 | } | 
| 164 | 163 |          if ($keys) { | 
| 165 | -            $coll->map(function ($v) use ($key) { unset($v[$key]); return $v; }); | |
| 164 | +            $coll->map(function($v) use ($key) { unset($v[$key]); return $v; }); | |
| 166 | 165 | } | 
| 167 | 166 | return $coll; | 
| 168 | 167 | } | 
| @@ -237,8 +236,7 @@ discard block | ||
| 237 | 236 | public function definition(string $table, bool $detectRelations = true) : Table | 
| 238 | 237 |      { | 
| 239 | 238 | return isset($this->tables[$table]) ? | 
| 240 | - $this->tables[$table] : | |
| 241 | - $this->driver->table($table, $detectRelations); | |
| 239 | + $this->tables[$table] : $this->driver->table($table, $detectRelations); | |
| 242 | 240 | } | 
| 243 | 241 | /** | 
| 244 | 242 | * Parse all tables from the database. | 
| @@ -255,12 +253,12 @@ discard block | ||
| 255 | 253 | */ | 
| 256 | 254 | public function getSchema($asPlainArray = true) | 
| 257 | 255 |      { | 
| 258 | -        return !$asPlainArray ? $this->tables : array_map(function ($table) { | |
| 256 | +        return !$asPlainArray ? $this->tables : array_map(function($table) { | |
| 259 | 257 | return [ | 
| 260 | 258 | 'name' => $table->getName(), | 
| 261 | 259 | 'pkey' => $table->getPrimaryKey(), | 
| 262 | 260 | 'comment' => $table->getComment(), | 
| 263 | -                'columns' => array_map(function ($column) { | |
| 261 | +                'columns' => array_map(function($column) { | |
| 264 | 262 | return [ | 
| 265 | 263 | 'name' => $column->getName(), | 
| 266 | 264 | 'type' => $column->getType(), | 
| @@ -270,13 +268,13 @@ discard block | ||
| 270 | 268 | 'nullable' => $column->isNullable() | 
| 271 | 269 | ]; | 
| 272 | 270 | }, $table->getFullColumns()), | 
| 273 | -                'relations' => array_map(function ($rel) { | |
| 271 | +                'relations' => array_map(function($rel) { | |
| 274 | 272 | $relation = clone $rel; | 
| 275 | 273 | $relation->table = $relation->table->getName(); | 
| 276 | 274 |                      if ($relation->pivot) { | 
| 277 | 275 | $relation->pivot = $relation->pivot->getName(); | 
| 278 | 276 | } | 
| 279 | - return (array)$relation; | |
| 277 | + return (array) $relation; | |
| 280 | 278 | }, $table->getRelations()) | 
| 281 | 279 | ]; | 
| 282 | 280 | }, $this->tables); | 
| @@ -12,7 +12,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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). | 
| @@ -23,8 +23,7 @@ | ||
| 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 | } | 
| @@ -62,7 +62,7 @@ | ||
| 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() | 
| @@ -64,7 +64,7 @@ | ||
| 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() | 
| @@ -125,16 +125,16 @@ discard block | ||
| 125 | 125 | $columns = Collection::from($this | 
| 126 | 126 | ->query( | 
| 127 | 127 | "SELECT * FROM all_tab_cols WHERE table_name = ? AND owner = ?", | 
| 128 | - [ strtoupper($table), $this->name() ] | |
| 128 | + [strtoupper($table), $this->name()] | |
| 129 | 129 | )) | 
| 130 | -            ->map(function ($v) { | |
| 130 | +            ->map(function($v) { | |
| 131 | 131 | $new = []; | 
| 132 | 132 |                  foreach ($v as $kk => $vv) { | 
| 133 | 133 | $new[strtoupper($kk)] = $vv; | 
| 134 | 134 | } | 
| 135 | 135 | return $new; | 
| 136 | 136 | }) | 
| 137 | -            ->mapKey(function ($v) { return $v['COLUMN_NAME']; }) | |
| 137 | +            ->mapKey(function($v) { return $v['COLUMN_NAME']; }) | |
| 138 | 138 | ->toArray(); | 
| 139 | 139 |          if (!count($columns)) { | 
| 140 | 140 |              throw new DBException('Table not found by name'); | 
| @@ -144,9 +144,9 @@ discard block | ||
| 144 | 144 | ->query( | 
| 145 | 145 | "SELECT constraint_name FROM all_constraints | 
| 146 | 146 | WHERE table_name = ? AND constraint_type = ? AND owner = ?", | 
| 147 | - [ strtoupper($table), 'P', $owner ] | |
| 147 | + [strtoupper($table), 'P', $owner] | |
| 148 | 148 | )) | 
| 149 | -            ->map(function ($v) { | |
| 149 | +            ->map(function($v) { | |
| 150 | 150 | $new = []; | 
| 151 | 151 |                  foreach ($v as $kk => $vv) { | 
| 152 | 152 | $new[strtoupper($kk)] = $vv; | 
| @@ -161,9 +161,9 @@ discard block | ||
| 161 | 161 | ->query( | 
| 162 | 162 | "SELECT column_name FROM all_cons_columns | 
| 163 | 163 | WHERE table_name = ? AND constraint_name = ? AND owner = ?", | 
| 164 | - [ strtoupper($table), $pkname, $owner ] | |
| 164 | + [strtoupper($table), $pkname, $owner] | |
| 165 | 165 | )) | 
| 166 | -                ->map(function ($v) { | |
| 166 | +                ->map(function($v) { | |
| 167 | 167 | $new = []; | 
| 168 | 168 |                      foreach ($v as $kk => $vv) { | 
| 169 | 169 | $new[strtoupper($kk)] = $vv; | 
| @@ -190,9 +190,9 @@ discard block | ||
| 190 | 190 | LEFT JOIN all_cons_columns cc ON cc.OWNER = ac.OWNER AND cc.CONSTRAINT_NAME = ac.CONSTRAINT_NAME | 
| 191 | 191 | WHERE ac.OWNER = ? AND ac.R_OWNER = ? AND ac.R_CONSTRAINT_NAME = ? AND ac.CONSTRAINT_TYPE = ? | 
| 192 | 192 | ORDER BY cc.POSITION", | 
| 193 | - [ $owner, $owner, $pkname, 'R' ] | |
| 193 | + [$owner, $owner, $pkname, 'R'] | |
| 194 | 194 | )) | 
| 195 | -                ->map(function ($v) { | |
| 195 | +                ->map(function($v) { | |
| 196 | 196 | $new = []; | 
| 197 | 197 |                      foreach ($v as $kk => $vv) { | 
| 198 | 198 | $new[strtoupper($kk)] = $vv; | 
| @@ -202,7 +202,7 @@ discard block | ||
| 202 | 202 | as $relation | 
| 203 | 203 |              ) { | 
| 204 | 204 | $relations[$relation['CONSTRAINT_NAME']]['table'] = $relation['TABLE_NAME']; | 
| 205 | - $relations[$relation['CONSTRAINT_NAME']]['keymap'][$primary[(int)$relation['POSITION']-1]] = $relation['COLUMN_NAME']; | |
| 205 | + $relations[$relation['CONSTRAINT_NAME']]['keymap'][$primary[(int) $relation['POSITION'] - 1]] = $relation['COLUMN_NAME']; | |
| 206 | 206 | } | 
| 207 | 207 |              foreach ($relations as $data) { | 
| 208 | 208 | $rtable = $this->table($data['table'], true); // ?? $this->addTableByName($data['table'], false); | 
| @@ -226,9 +226,9 @@ discard block | ||
| 226 | 226 | ac.OWNER = ? AND ac.R_OWNER = ? AND ac.TABLE_NAME = ? AND ac.CONSTRAINT_TYPE = ? AND | 
| 227 | 227 | cc.COLUMN_NAME IN (??) | 
| 228 | 228 | ORDER BY POSITION", | 
| 229 | - [ $owner, $owner, $data['table'], 'R', $columns ] | |
| 229 | + [$owner, $owner, $data['table'], 'R', $columns] | |
| 230 | 230 | )) | 
| 231 | -                        ->map(function ($v) { | |
| 231 | +                        ->map(function($v) { | |
| 232 | 232 | $new = []; | 
| 233 | 233 |                              foreach ($v as $kk => $vv) { | 
| 234 | 234 | $new[strtoupper($kk)] = $vv; | 
| @@ -246,9 +246,9 @@ discard block | ||
| 246 | 246 | $rcolumns = Collection::from($this | 
| 247 | 247 | ->query( | 
| 248 | 248 | "SELECT COLUMN_NAME FROM all_cons_columns WHERE OWNER = ? AND CONSTRAINT_NAME = ? ORDER BY POSITION", | 
| 249 | - [ $owner, current($foreign['keymap']) ] | |
| 249 | + [$owner, current($foreign['keymap'])] | |
| 250 | 250 | )) | 
| 251 | -                        ->map(function ($v) { | |
| 251 | +                        ->map(function($v) { | |
| 252 | 252 | $new = []; | 
| 253 | 253 |                              foreach ($v as $kk => $vv) { | 
| 254 | 254 | $new[strtoupper($kk)] = $vv; | 
| @@ -263,7 +263,7 @@ discard block | ||
| 263 | 263 | $relname = $foreign['table']; | 
| 264 | 264 | $cntr = 1; | 
| 265 | 265 |                      while ($definition->hasRelation($relname) || $definition->getName() == $relname) { | 
| 266 | - $relname = $foreign['table'] . '_' . (++ $cntr); | |
| 266 | + $relname = $foreign['table'].'_'.(++$cntr); | |
| 267 | 267 | } | 
| 268 | 268 | $definition->addRelation( | 
| 269 | 269 | new TableRelation( | 
| @@ -279,7 +279,7 @@ discard block | ||
| 279 | 279 | $relname = $data['table']; | 
| 280 | 280 | $cntr = 1; | 
| 281 | 281 |                      while ($definition->hasRelation($relname) || $definition->getName() == $relname) { | 
| 282 | - $relname = $data['table'] . '_' . (++ $cntr); | |
| 282 | + $relname = $data['table'].'_'.(++$cntr); | |
| 283 | 283 | } | 
| 284 | 284 | $definition->addRelation( | 
| 285 | 285 | new TableRelation( | 
| @@ -303,9 +303,9 @@ discard block | ||
| 303 | 303 | LEFT JOIN all_cons_columns cc ON cc.OWNER = ac.OWNER AND cc.CONSTRAINT_NAME = ac.CONSTRAINT_NAME | 
| 304 | 304 | WHERE ac.OWNER = ? AND ac.R_OWNER = ? AND ac.TABLE_NAME = ? AND ac.CONSTRAINT_TYPE = ? | 
| 305 | 305 | ORDER BY cc.POSITION", | 
| 306 | - [ $owner, $owner, strtoupper($table), 'R' ] | |
| 306 | + [$owner, $owner, strtoupper($table), 'R'] | |
| 307 | 307 | )) | 
| 308 | -                ->map(function ($v) { | |
| 308 | +                ->map(function($v) { | |
| 309 | 309 | $new = []; | 
| 310 | 310 |                      foreach ($v as $kk => $vv) { | 
| 311 | 311 | $new[strtoupper($kk)] = $vv; | 
| @@ -321,9 +321,9 @@ discard block | ||
| 321 | 321 | $rcolumns = Collection::from($this | 
| 322 | 322 | ->query( | 
| 323 | 323 | "SELECT COLUMN_NAME FROM all_cons_columns WHERE OWNER = ? AND CONSTRAINT_NAME = ? ORDER BY POSITION", | 
| 324 | - [ $owner, current($data['keymap']) ] | |
| 324 | + [$owner, current($data['keymap'])] | |
| 325 | 325 | )) | 
| 326 | -                    ->map(function ($v) { | |
| 326 | +                    ->map(function($v) { | |
| 327 | 327 | $new = []; | 
| 328 | 328 |                          foreach ($v as $kk => $vv) { | 
| 329 | 329 | $new[strtoupper($kk)] = $vv; | 
| @@ -338,7 +338,7 @@ discard block | ||
| 338 | 338 | $relname = $data['table']; | 
| 339 | 339 | $cntr = 1; | 
| 340 | 340 |                  while ($definition->hasRelation($relname) || $definition->getName() == $relname) { | 
| 341 | - $relname = $data['table'] . '_' . (++ $cntr); | |
| 341 | + $relname = $data['table'].'_'.(++$cntr); | |
| 342 | 342 | } | 
| 343 | 343 | $definition->addRelation( | 
| 344 | 344 | new TableRelation( | 
| @@ -359,7 +359,7 @@ discard block | ||
| 359 | 359 | "SELECT TABLE_NAME FROM ALL_TABLES where OWNER = ?", | 
| 360 | 360 | [$this->connection['name']] | 
| 361 | 361 | )) | 
| 362 | -            ->map(function ($v) { | |
| 362 | +            ->map(function($v) { | |
| 363 | 363 | $new = []; | 
| 364 | 364 |                  foreach ($v as $kk => $vv) { | 
| 365 | 365 | $new[strtoupper($kk)] = $vv; | 
| @@ -367,7 +367,7 @@ discard block | ||
| 367 | 367 | return $new; | 
| 368 | 368 | }) | 
| 369 | 369 |              ->pluck('TABLE_NAME') | 
| 370 | -            ->map(function ($v) { | |
| 370 | +            ->map(function($v) { | |
| 371 | 371 | return $this->table($v); | 
| 372 | 372 | }) | 
| 373 | 373 | ->toArray(); | 
| @@ -62,7 +62,7 @@ | ||
| 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() | 
| @@ -29,7 +29,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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() | 
| @@ -36,7 +36,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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(); |