Completed
Branch great-split (fb1d0f)
by Anton
04:14
created
source/Spiral/Database/Builders/Traits/JoinsTrait.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -346,7 +346,7 @@
 block discarded – undo
346 346
      * @param string                 $joiner     Boolean joiner (AND | OR).
347 347
      * @param array                  $parameters Set of parameters collected from where functions.
348 348
      * @param array                  $tokens     Array to aggregate compiled tokens. Reference.
349
-     * @param \Closure|null|callable $wrapper    Callback or closure used to wrap/collect every
349
+     * @param callable $wrapper    Callback or closure used to wrap/collect every
350 350
      *                                           potential parameter.
351 351
      *
352 352
      * @throws BuilderException
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
      */
351 351
     private function onWrapper()
352 352
     {
353
-        return function ($parameter) {
353
+        return function($parameter) {
354 354
             if ($parameter instanceof FragmentInterface) {
355 355
                 return $parameter;
356 356
             }
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
      */
367 367
     private function onWhereWrapper()
368 368
     {
369
-        return function ($parameter) {
369
+        return function($parameter) {
370 370
             if ($parameter instanceof FragmentInterface) {
371 371
                 //We are only not creating bindings for plan fragments
372 372
                 if (!$parameter instanceof ParameterInterface && !$parameter instanceof QueryBuilder) {
Please login to merge, or discard this patch.
source/Spiral/Database/Entities/Database.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -345,7 +345,7 @@
 block discarded – undo
345 345
      */
346 346
     public function hasTable(string $name): bool
347 347
     {
348
-        return $this->driver->hasTable($this->prefix . $name);
348
+        return $this->driver->hasTable($this->prefix.$name);
349 349
     }
350 350
 
351 351
     /**
Please login to merge, or discard this patch.
source/Spiral/Tokenizer/Isolator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             if ($this->isCloseTag($token)) {
74 74
                 $blockID = $this->uniqueID();
75 75
 
76
-                $this->phpBlocks[$blockID] = $phpBlock . $token[1];
76
+                $this->phpBlocks[$blockID] = $phpBlock.$token[1];
77 77
                 $isolated .= $this->placeholder($blockID);
78 78
 
79 79
                 $phpBlock = '';
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     {
139 139
         return preg_replace_callback(
140 140
             $this->blockRegex(),
141
-            function ($match) use ($partial, $blockIDs) {
141
+            function($match) use ($partial, $blockIDs) {
142 142
                 if ($partial && !in_array($match['id'], $blockIDs)) {
143 143
                     return $match[0];
144 144
                 }
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      */
180 180
     private function blockRegex(): string
181 181
     {
182
-        return '/' .
182
+        return '/'.
183 183
             preg_quote($this->prefix)
184 184
             . '(?P<id>[0-9a-z]+)'
185 185
             . preg_quote($this->postfix)
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      */
192 192
     private function uniqueID(): string
193 193
     {
194
-        return md5(count($this->phpBlocks) . uniqid(true));
194
+        return md5(count($this->phpBlocks).uniqid(true));
195 195
     }
196 196
 
197 197
     /**
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
      */
202 202
     private function placeholder(string $blockID): string
203 203
     {
204
-        return $this->prefix . $blockID . $this->postfix;
204
+        return $this->prefix.$blockID.$this->postfix;
205 205
     }
206 206
 
207 207
     /**
Please login to merge, or discard this patch.
source/Spiral/Database/Schemas/Prototypes/AbstractReference.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         string $column = 'id',
156 156
         bool $forcePrefix = true
157 157
     ): AbstractReference {
158
-        $this->foreignTable = ($forcePrefix ? $this->tablePrefix : '') . $table;
158
+        $this->foreignTable = ($forcePrefix ? $this->tablePrefix : '').$table;
159 159
         $this->foreignKey = $column;
160 160
 
161 161
         return $this;
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
         $statement[] = 'CONSTRAINT';
204 204
         $statement[] = $driver->identifier($this->name);
205 205
         $statement[] = 'FOREIGN KEY';
206
-        $statement[] = '(' . $driver->identifier($this->column) . ')';
206
+        $statement[] = '('.$driver->identifier($this->column).')';
207 207
 
208
-        $statement[] = 'REFERENCES ' . $driver->identifier($this->foreignTable);
209
-        $statement[] = '(' . $driver->identifier($this->foreignKey) . ')';
208
+        $statement[] = 'REFERENCES '.$driver->identifier($this->foreignTable);
209
+        $statement[] = '('.$driver->identifier($this->foreignKey).')';
210 210
 
211 211
         $statement[] = "ON DELETE {$this->deleteRule}";
212 212
         $statement[] = "ON UPDATE {$this->updateRule}";
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/Postgres/PostgresCompiler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
                 $table,
29 29
                 $columns,
30 30
                 $rowsets
31
-            ) . (!empty($primaryKey) ? ' RETURNING ' . $this->quote($primaryKey) : '');
31
+            ).(!empty($primaryKey) ? ' RETURNING '.$this->quote($primaryKey) : '');
32 32
     }
33 33
 
34 34
     /**
@@ -40,6 +40,6 @@  discard block
 block discarded – undo
40 40
             return '';
41 41
         }
42 42
 
43
-        return 'DISTINCT' . (is_string($distinct) ? '(' . $this->quote($distinct) . ')' : '');
43
+        return 'DISTINCT'.(is_string($distinct) ? '('.$this->quote($distinct).')' : '');
44 44
     }
45 45
 }
Please login to merge, or discard this patch.
source/Spiral/Database/Schemas/Prototypes/AbstractTable.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
         $this->prefix = $prefix;
114 114
 
115 115
         //Initializing states
116
-        $this->initial = new TableState($this->prefix . $name);
117
-        $this->current = new TableState($this->prefix . $name);
116
+        $this->initial = new TableState($this->prefix.$name);
117
+        $this->current = new TableState($this->prefix.$name);
118 118
 
119 119
         if ($this->driver->hasTable($this->getName())) {
120 120
             $this->status = self::STATUS_EXISTS;
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      */
194 194
     public function setName(string $name): string
195 195
     {
196
-        $this->current->setName($this->prefix . $name);
196
+        $this->current->setName($this->prefix.$name);
197 197
 
198 198
         return $this->getName();
199 199
     }
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
     {
484 484
         if ($this->hasIndex($columns)) {
485 485
             throw new SchemaException(
486
-                "Undefined index ['" . join("', '", $columns) . "'] in '{$this->getName()}'"
486
+                "Undefined index ['".join("', '", $columns)."'] in '{$this->getName()}'"
487 487
             );
488 488
         }
489 489
 
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
     {
528 528
         if (empty($schema = $this->current->findIndex($columns))) {
529 529
             throw new SchemaException(
530
-                "Undefined index ['" . join("', '", $columns) . "'] in '{$this->getName()}'"
530
+                "Undefined index ['".join("', '", $columns)."'] in '{$this->getName()}'"
531 531
             );
532 532
         }
533 533
 
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
      */
749 749
     protected function createIdentifier(string $type, array $columns): string
750 750
     {
751
-        $name = $this->getName() . '_' . $type . '_' . join('_', $columns) . '_' . uniqid();
751
+        $name = $this->getName().'_'.$type.'_'.join('_', $columns).'_'.uniqid();
752 752
 
753 753
         if (strlen($name) > 64) {
754 754
             //Many DBMS has limitations on identifier length
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/SQLite/Schemas/SQLiteTable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
     private function columnSchemas(array $include = []): array
84 84
     {
85 85
         $columns = $this->driver->query(
86
-            "PRAGMA TABLE_INFO(" . $this->driver->quote($this->getName()) . ")"
86
+            "PRAGMA TABLE_INFO(".$this->driver->quote($this->getName()).")"
87 87
         );
88 88
 
89 89
         $result = [];
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/SQLServer/SQLServerHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
         AbstractColumn $column
107 107
     ) {
108 108
         $this->run("sp_rename ?, ?, 'COLUMN'", [
109
-            $table->getName() . '.' . $initial->getName(),
109
+            $table->getName().'.'.$initial->getName(),
110 110
             $column->getName()
111 111
         ]);
112 112
     }
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/SQLServer/Schemas/SQLServerColumn.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
                 }
251 251
 
252 252
                 $type = "ALTER COLUMN {$driver->identifier($this->getName())} varchar($enumSize)";
253
-                $operations[] = $type . ' ' . ($this->nullable ? 'NULL' : 'NOT NULL');
253
+                $operations[] = $type.' '.($this->nullable ? 'NULL' : 'NOT NULL');
254 254
             } else {
255 255
                 $type = "ALTER COLUMN {$driver->identifier($this->getName())} {$this->type}";
256 256
 
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                     $type .= "($this->precision, $this->scale)";
263 263
                 }
264 264
 
265
-                $operations[] = $type . ' ' . ($this->nullable ? 'NULL' : 'NOT NULL');
265
+                $operations[] = $type.' '.($this->nullable ? 'NULL' : 'NOT NULL');
266 266
             }
267 267
         }
268 268
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
     protected function enumConstraint()
290 290
     {
291 291
         if (empty($this->enumConstraint)) {
292
-            $this->enumConstraint = $this->table . '_' . $this->getName() . '_enum_' . uniqid();
292
+            $this->enumConstraint = $this->table.'_'.$this->getName().'_enum_'.uniqid();
293 293
         }
294 294
 
295 295
         return $this->enumConstraint;
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
     protected function defaultConstrain(): string
304 304
     {
305 305
         if (empty($this->defaultConstraint)) {
306
-            $this->defaultConstraint = $this->table . '_' . $this->getName() . '_default_' . uniqid();
306
+            $this->defaultConstraint = $this->table.'_'.$this->getName().'_default_'.uniqid();
307 307
         }
308 308
 
309 309
         return $this->defaultConstraint;
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 
437 437
             //We made some assumptions here...
438 438
             if (preg_match_all(
439
-                '/' . $name . '=[\']?([^\']+)[\']?/i',
439
+                '/'.$name.'=[\']?([^\']+)[\']?/i',
440 440
                 $constraint['definition'],
441 441
                 $matches
442 442
             )) {
Please login to merge, or discard this patch.