@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | public function createDatabase($name): bool |
39 | 39 | { |
40 | 40 | return $this->connection->statement( |
41 | - $this->grammar->compileCreateDatabase($name, $this->connection) |
|
41 | + $this->grammar->compileCreateDatabase($name, $this->connection) |
|
42 | 42 | ); |
43 | 43 | } |
44 | 44 | |
@@ -152,10 +152,10 @@ discard block |
||
152 | 152 | public function getAllTables() |
153 | 153 | { |
154 | 154 | return $this->connection->select( |
155 | - $this->grammar->compileGetAllTables( |
|
156 | - $this->connection->getConfig('schema') |
|
157 | - ) |
|
158 | - ); |
|
155 | + $this->grammar->compileGetAllTables( |
|
156 | + $this->connection->getConfig('schema') |
|
157 | + ) |
|
158 | + ); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | public function getAllViews() |
167 | 167 | { |
168 | 168 | return $this->connection->select( |
169 | - $this->grammar->compileGetAllViews( |
|
170 | - $this->connection->getConfig('schema') |
|
171 | - ) |
|
172 | - ); |
|
169 | + $this->grammar->compileGetAllViews( |
|
170 | + $this->connection->getConfig('schema') |
|
171 | + ) |
|
172 | + ); |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | \ No newline at end of file |
@@ -957,7 +957,7 @@ |
||
957 | 957 | */ |
958 | 958 | protected function modifyDefault(Dataprint $dataprint, Flowing $column) |
959 | 959 | { |
960 | - if ( ! is_null($column->default)) { |
|
960 | + if ( ! is_null($column->default)) { |
|
961 | 961 | return " default ".$this->getDefaultValue($column->default); |
962 | 962 | } |
963 | 963 | } |
@@ -885,7 +885,9 @@ |
||
885 | 885 | */ |
886 | 886 | protected function modifyUnsigned(Dataprint $dataprint, Flowing $column): string |
887 | 887 | { |
888 | - if ($column->unsigned) return ' unsigned'; |
|
888 | + if ($column->unsigned) { |
|
889 | + return ' unsigned'; |
|
890 | + } |
|
889 | 891 | } |
890 | 892 | |
891 | 893 | /** |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | return sprintf('create database %s enconding %s', |
59 | 59 | $this->wrapValue($name), |
60 | 60 | $this->wrapValue($connection->getConfig('charset')), |
61 | - ); |
|
61 | + ); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $dataprint->temporary ? 'create temporary' : 'create', |
108 | 108 | $this->wrapTable($dataprint), |
109 | 109 | implode(', ', $this->getColumns($dataprint)) |
110 | - ); |
|
110 | + ); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | return sprintf('alter table %s %s', |
124 | 124 | $this->wrapTable($dataprint), |
125 | 125 | implode(', ', $this->prefixArray('add column', $this->getColumns($dataprint))) |
126 | - ); |
|
126 | + ); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $this->wrapTable($dataprint), |
156 | 156 | $this->wrap($command->index), |
157 | 157 | $this->columnize($command->columns) |
158 | - ); |
|
158 | + ); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $this->wrapTable($dataprint), |
174 | 174 | $command->option ? ' using '.$command->option : '', |
175 | 175 | $this->columnize($command->columns) |
176 | - ); |
|
176 | + ); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $this->wrap($command->index), |
191 | 191 | $this->wrapTable($dataprint), |
192 | 192 | implode(' || ', $command->columns) |
193 | - ); |
|
193 | + ); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | /** |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | return sprintf('alter table %s rename to %s', |
386 | 386 | $this->wrap($command->from), |
387 | 387 | $this->wrap($command->to) |
388 | - ); |
|
388 | + ); |
|
389 | 389 | } |
390 | 390 | |
391 | 391 | /** |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | $this->wrapTable($dataprint), |
471 | 471 | $this->wrap($command->column->name), |
472 | 472 | "'".str_replace("'", "''", $command->value)."'" |
473 | - ); |
|
473 | + ); |
|
474 | 474 | } |
475 | 475 | |
476 | 476 | /** |
@@ -873,7 +873,7 @@ |
||
873 | 873 | */ |
874 | 874 | protected function modifyDefault(Dataprint $dataprint, Flowing $column) |
875 | 875 | { |
876 | - if ( ! is_null($column->default)) { |
|
876 | + if ( ! is_null($column->default)) { |
|
877 | 877 | return ' default '.$this->getDefaultValue($column->default); |
878 | 878 | } |
879 | 879 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | implode(', ', $this->getColumns($dataprint)), |
85 | 85 | (string) $this->addForeignKeys($dataprint), |
86 | 86 | (string) $this->addPrimaryKeys($dataprint) |
87 | - ); |
|
87 | + ); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $this->columnize($foreign->columns), |
127 | 127 | $this->wrapTable($foreign->on), |
128 | 128 | $this->columnize((array) $foreign->references) |
129 | - ); |
|
129 | + ); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $this->wrap($command->index), |
176 | 176 | $this->wrapTable($dataprint), |
177 | 177 | $this->columnize($command->columns) |
178 | - ); |
|
178 | + ); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $this->wrap($command->index), |
193 | 193 | $this->wrapTable($dataprint), |
194 | 194 | $this->columnize($command->columns) |
195 | - ); |
|
195 | + ); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | return sprintf('alter table %s rename to %s', |
339 | 339 | $this->wrap($command->from), |
340 | 340 | $this->wrap($command->to) |
341 | - ); |
|
341 | + ); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | /** |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | return sprintf('varchar check ("%s" in (%s))', |
631 | 631 | $column->name, |
632 | 632 | $this->quoteString($column->allowed) |
633 | - ); |
|
633 | + ); |
|
634 | 634 | } |
635 | 635 | |
636 | 636 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | $foreigns = $this->getCommandsByName($dataprint, 'foreign'); |
100 | 100 | |
101 | - return collect($foreigns)->reduce(function ($sql, $foreign) { |
|
101 | + return collect($foreigns)->reduce(function($sql, $foreign) { |
|
102 | 102 | $sql .= $this->getForeignKey($foreign); |
103 | 103 | |
104 | 104 | if ( ! is_null($foreign->onDelete)) { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | { |
156 | 156 | $columns = $this->prefixArray('add column', $this->getColumns($dataprint)); |
157 | 157 | |
158 | - return collect($columns)->map(function ($column) use ($dataprint) { |
|
158 | + return collect($columns)->map(function($column) use ($dataprint) { |
|
159 | 159 | return 'alter table '.$this->wrapTable($dataprint).' '.$column; |
160 | 160 | })->all(); |
161 | 161 | |
@@ -801,7 +801,7 @@ discard block |
||
801 | 801 | */ |
802 | 802 | protected function modifyDefault(Dataprint $dataprint, Flowing $column) |
803 | 803 | { |
804 | - if ( ! is_null($column->default)) { |
|
804 | + if ( ! is_null($column->default)) { |
|
805 | 805 | return ' default '.$this->getDefaultValue($column->default); |
806 | 806 | } |
807 | 807 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | return sprintf('alter table %s add %s', |
126 | 126 | $this->wrapTable($dataprint), |
127 | 127 | implode(', ', $this->getColumns($dataprint)) |
128 | - ); |
|
128 | + ); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $this->wrapTable($dataprint), |
143 | 143 | $this->wrap($command->index), |
144 | 144 | $this->columnize($command->columns) |
145 | - ); |
|
145 | + ); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $this->wrap($command->index), |
160 | 160 | $this->wrapTable($dataprint), |
161 | 161 | $this->columnize($command->columns) |
162 | - ); |
|
162 | + ); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $this->wrap($command->index), |
177 | 177 | $this->wrapTable($dataprint), |
178 | 178 | $this->columnize($command->columns) |
179 | - ); |
|
179 | + ); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $this->wrap($command->index), |
194 | 194 | $this->wrapTable($dataprint), |
195 | 195 | $this->columnize($command->columns) |
196 | - ); |
|
196 | + ); |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | /** |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | return sprintf('if exists (select * from sys.sysobjects where id = object_id(%s, \'U\')) drop table %s', |
223 | 223 | "'".str_replace("'", "''", $this->getTablePrefix().$dataprint->getTable())."'", |
224 | 224 | $this->wrapTable($dataprint) |
225 | - ); |
|
225 | + ); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | return sprintf("sp_rename N'%s', %s, N'INDEX'", |
340 | 340 | $this->wrap($dataprint->getTable().'.'.$command->from), |
341 | 341 | $this->wrap($command->to) |
342 | - ); |
|
342 | + ); |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | /** |
@@ -873,7 +873,7 @@ |
||
873 | 873 | */ |
874 | 874 | protected function modifyDefault(Dataprint $dataprint, Flowing $column) |
875 | 875 | { |
876 | - if ( ! is_null($column->default)) { |
|
876 | + if ( ! is_null($column->default)) { |
|
877 | 877 | return ' default '.$this->getDefaultValue($column->default); |
878 | 878 | } |
879 | 879 | } |
@@ -116,7 +116,9 @@ |
||
116 | 116 | $this->table = $table; |
117 | 117 | $this->prefix = $prefix; |
118 | 118 | |
119 | - if ( ! is_null($callback)) $callback($this); |
|
119 | + if ( ! is_null($callback)) { |
|
120 | + $callback($this); |
|
121 | + } |
|
120 | 122 | } |
121 | 123 | |
122 | 124 | /** |
@@ -121,7 +121,7 @@ |
||
121 | 121 | ? $this->wrapTable($segment) |
122 | 122 | : $this->wrapValue($segment); |
123 | 123 | } |
124 | - )->implode('.'); |
|
124 | + )->implode('.'); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -116,7 +116,7 @@ |
||
116 | 116 | */ |
117 | 117 | protected function wrapSegments($segments): string |
118 | 118 | { |
119 | - return collect($segments)->map(function ($segment, $key) use ($segments) { |
|
119 | + return collect($segments)->map(function($segment, $key) use ($segments) { |
|
120 | 120 | return $key == 0 && count($segments) > 1 |
121 | 121 | ? $this->wrapTable($segment) |
122 | 122 | : $this->wrapValue($segment); |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | */ |
269 | 269 | public function select(string $query, array $bindings = [], bool $useReadPdo = true): array |
270 | 270 | { |
271 | - return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) { |
|
271 | + return $this->run($query, $bindings, function($query, $bindings) use ($useReadPdo) { |
|
272 | 272 | if ($this->pretending()) { |
273 | 273 | return []; |
274 | 274 | } |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | */ |
335 | 335 | public function statement(string $query, array $bindings = []): bool |
336 | 336 | { |
337 | - return $this->run($query, $bindings, function ($query, $bindings) { |
|
337 | + return $this->run($query, $bindings, function($query, $bindings) { |
|
338 | 338 | if ($this->pretending()) { |
339 | 339 | return true; |
340 | 340 | } |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | */ |
358 | 358 | public function affectingStatement(string $query, array $bindings = []): int |
359 | 359 | { |
360 | - return $this->run($query, $bindings, function ($query, $bindings) { |
|
360 | + return $this->run($query, $bindings, function($query, $bindings) { |
|
361 | 361 | if ($this->pretending()) { |
362 | 362 | return 0; |
363 | 363 | } |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | */ |
384 | 384 | public function prepend(Closure $callback): array |
385 | 385 | { |
386 | - return $this->withFreshQueryLog(function () use ($callback) { |
|
386 | + return $this->withFreshQueryLog(function() use ($callback) { |
|
387 | 387 | $this->pretending = true; |
388 | 388 | |
389 | 389 | $callback($this); |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | * |
402 | 402 | * @return array|Closure |
403 | 403 | */ |
404 | - protected function withFreshQueryLog(Closure $callback): array|Closure |
|
404 | + protected function withFreshQueryLog(Closure $callback): array | Closure |
|
405 | 405 | { |
406 | 406 | $loggingQueries = $this->loggingQueries; |
407 | 407 |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | { |
318 | 318 | $this->addSelect(new Expression($expression)); |
319 | 319 | |
320 | - if (! empty($bindings)) { |
|
320 | + if ( ! empty($bindings)) { |
|
321 | 321 | $this->addBinding($bindings, 'select'); |
322 | 322 | } |
323 | 323 | |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | */ |
430 | 430 | protected function addArrayWheres($column, $boolean, $method = 'where'): static |
431 | 431 | { |
432 | - return $this->whereNested(function ($query) use ($column, $method, $boolean) { |
|
432 | + return $this->whereNested(function($query) use ($column, $method, $boolean) { |
|
433 | 433 | foreach ((array) $column as $key => $value) { |
434 | 434 | if (is_numeric($key) && is_array($value)) { |
435 | 435 | $query->{$method}(...array_values($value)); |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | 'boolean' => $boolean |
567 | 567 | ]; |
568 | 568 | |
569 | - $this->addBinding((array) $bindings, 'where'); |
|
569 | + $this->addBinding((array) $bindings, 'where'); |
|
570 | 570 | |
571 | 571 | return $this; |
572 | 572 | } |
@@ -1361,7 +1361,7 @@ discard block |
||
1361 | 1361 | */ |
1362 | 1362 | public function get($columns = ['*']) |
1363 | 1363 | { |
1364 | - return collect($this->getFresh(Arr::wrap($columns), function () { |
|
1364 | + return collect($this->getFresh(Arr::wrap($columns), function() { |
|
1365 | 1365 | return $this->getWithStatement(); |
1366 | 1366 | })); |
1367 | 1367 | } |
@@ -1491,7 +1491,7 @@ discard block |
||
1491 | 1491 | |
1492 | 1492 | $this->columns = $previous; |
1493 | 1493 | |
1494 | - if (isset($results[0])) { |
|
1494 | + if (isset($results[0])) { |
|
1495 | 1495 | $result = array_change_key_case((array) $results[0]); |
1496 | 1496 | } |
1497 | 1497 |