Passed
Push — 0.8.x ( c36ed7...20ecf3 )
by Alexander
07:28 queued 04:02
created
src/components/Database/Schema/Grammars/SQLiteGrammar.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/components/Database/Schema/Grammars/SqlServerGrammar.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -873,7 +873,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/components/Database/Schema/Dataprint.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -116,7 +116,9 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/components/Database/Grammar.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@
 block discarded – undo
121 121
                         ? $this->wrapTable($segment)
122 122
                         : $this->wrapValue($segment);
123 123
                     }
124
-               )->implode('.');
124
+                )->implode('.');
125 125
     }
126 126
 
127 127
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/components/Database/Connections/Connection.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         
Please login to merge, or discard this patch.
src/components/Database/Query/Builder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/components/Database/Query/Grammars/PostgresGrammar.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -63,13 +63,13 @@
 block discarded – undo
63 63
         return $this->compileInsert($builder, $values).' returning '.$this->wrap($sequence);
64 64
     }
65 65
 
66
-     /**
67
-     * Compile a truncate table statement into SQL.
68
-     * 
69
-     * @param  \Syscodes\Components\Database\Query\Builder  $builder
70
-     * 
71
-     * @return array
72
-     */
66
+        /**
67
+         * Compile a truncate table statement into SQL.
68
+         * 
69
+         * @param  \Syscodes\Components\Database\Query\Builder  $builder
70
+         * 
71
+         * @return array
72
+         */
73 73
     public function truncate(Builder $builder): array
74 74
     {
75 75
         return ['truncate table '.$this->wrapTable($builder->from).' restart identity cascade' => []];
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
      */
59 59
     public function compileInsertGetId(Builder $builder, $values, $sequence): string
60 60
     {
61
-        if (is_null($sequence)) $sequence = 'id' ;
61
+        if (is_null($sequence)) $sequence = 'id';
62 62
 
63 63
         return $this->compileInsert($builder, $values).' returning '.$this->wrap($sequence);
64 64
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,9 @@
 block discarded – undo
58 58
      */
59 59
     public function compileInsertGetId(Builder $builder, $values, $sequence): string
60 60
     {
61
-        if (is_null($sequence)) $sequence = 'id' ;
61
+        if (is_null($sequence)) {
62
+            $sequence = 'id' ;
63
+        }
62 64
 
63 65
         return $this->compileInsert($builder, $values).' returning '.$this->wrap($sequence);
64 66
     }
Please login to merge, or discard this patch.
src/components/Database/Query/Grammars/Grammar.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
         $columns = $this->columnize(array_keys(headItem($values)));
815 815
 
816 816
         $parameters = collect($values)->map(fn ($record) => '('.$this->parameterize($record).')')
817
-                                      ->implode(', ');
817
+                                        ->implode(', ');
818 818
 
819 819
         return "insert into $table ($columns) values $parameters";
820 820
     }
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
      */
918 918
     public function compileUpdateWithoutJoins(Builder $builder, $table, $columns, $where): string
919 919
     {
920
-       return "update {$table} set {$columns} {$where}";
920
+        return "update {$table} set {$columns} {$where}";
921 921
     }
922 922
 
923 923
     /**
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
      */
971 971
     public function compileDeleteWithoutJoins(Builder $builder, $table, $where): string
972 972
     {
973
-       return "delete from {$table} {$where}";
973
+        return "delete from {$table} {$where}";
974 974
     }
975 975
 
976 976
     /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
             $clauses = [];
159 159
 
160
-            foreach ($join->clauses as $clause)  {
160
+            foreach ($join->clauses as $clause) {
161 161
                 $clauses[] = $this->compileJoinContraint($clause);
162 162
             }
163 163
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
      */
220 220
     protected function compileWheresToArray($query): array
221 221
     {
222
-        return collect($query->wheres)->map(function ($where) use ($query) {
222
+        return collect($query->wheres)->map(function($where) use ($query) {
223 223
             return $where['boolean'].' '.$this->{"where{$where['type']}"}($query, $where);
224 224
         })->all();
225 225
     }
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -340,7 +340,9 @@  discard block
 block discarded – undo
340 340
      */
341 341
     protected function whereIn(Builder $builder, $where): string
342 342
     {
343
-        if (empty($where['values'])) return '0 = 1';
343
+        if (empty($where['values'])) {
344
+            return '0 = 1';
345
+        }
344 346
         
345 347
         return $this->wrap($where['column']).' in ('.$this->parameterize($where['values']).')';
346 348
     }
@@ -355,7 +357,9 @@  discard block
 block discarded – undo
355 357
      */
356 358
     protected function whereNotIn(Builder $builder, $where): string
357 359
     {
358
-        if (empty($where['query'])) return '1 = 1';
360
+        if (empty($where['query'])) {
361
+            return '1 = 1';
362
+        }
359 363
 
360 364
         $values = $this->parameterize($where['query']);
361 365
 
@@ -372,7 +376,9 @@  discard block
 block discarded – undo
372 376
      */
373 377
     protected function whereNotInRaw(Builder $builder, $where): string
374 378
     {
375
-        if (empty($where['values'])) return '1 = 1';
379
+        if (empty($where['values'])) {
380
+            return '1 = 1';
381
+        }
376 382
         
377 383
         return $this->wrap($where['column']).' not in ('.implode(', ', $where['values']).')';
378 384
     }
@@ -387,7 +393,9 @@  discard block
 block discarded – undo
387 393
      */
388 394
     protected function whereInRaw(Builder $builder, $where): string
389 395
     {
390
-        if (empty($where['values'])) return '0 = 1';
396
+        if (empty($where['values'])) {
397
+            return '0 = 1';
398
+        }
391 399
         
392 400
         return $this->wrap($where['column']).' in ('.implode(', ', $where['values']).')';
393 401
     }
Please login to merge, or discard this patch.
src/components/Database/Query/Grammars/SqlServerGrammar.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -181,13 +181,13 @@
 block discarded – undo
181 181
         return 'select * from ('.$sql.') as '.$this->wrapTable('temp_table');
182 182
     }
183 183
 
184
-     /**
185
-     * Compile a truncate table statement into SQL.
186
-     * 
187
-     * @param  \Syscodes\Components\Database\Query\Builder  $builder
188
-     * 
189
-     * @return array
190
-     */
184
+        /**
185
+         * Compile a truncate table statement into SQL.
186
+         * 
187
+         * @param  \Syscodes\Components\Database\Query\Builder  $builder
188
+         * 
189
+         * @return array
190
+         */
191 191
     public function truncate(Builder $builder): array
192 192
     {
193 193
         return ['truncate table '.$this->wrapTable($builder->from) => []];
Please login to merge, or discard this patch.