Completed
Branch feature/pre-split (1b5228)
by Anton
03:14
created
source/Spiral/Database/Drivers/Postgres/Schemas/PostgresColumn.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 
258 258
         //Dropping enum constrain before any operation
259 259
         if ($initial->abstractType() == 'enum' && $this->constrained) {
260
-            $operations[] = 'DROP CONSTRAINT ' . $driver->identifier($this->enumConstraint());
260
+            $operations[] = 'DROP CONSTRAINT '.$driver->identifier($this->enumConstraint());
261 261
         }
262 262
 
263 263
         //Default value set and dropping
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
         //Nullable option
273 273
         if ($initial->nullable != $this->nullable) {
274
-            $operations[] = "ALTER COLUMN {$identifier} " . (!$this->nullable ? 'SET' : 'DROP') . ' NOT NULL';
274
+            $operations[] = "ALTER COLUMN {$identifier} ".(!$this->nullable ? 'SET' : 'DROP').' NOT NULL';
275 275
         }
276 276
 
277 277
         if ($this->abstractType() == 'enum') {
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
             }
282 282
 
283 283
             $operations[] = "ADD CONSTRAINT {$driver->identifier($this->enumConstraint())} "
284
-                . "CHECK ({$identifier} IN (" . implode(', ', $enumValues) . '))';
284
+                . "CHECK ({$identifier} IN (".implode(', ', $enumValues).'))';
285 285
         }
286 286
 
287 287
         return $operations;
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     protected function prepareEnum(Driver $driver): string
294 294
     {
295 295
         //Postgres enums are just constrained strings
296
-        return '(' . $this->size . ')';
296
+        return '('.$this->size.')';
297 297
     }
298 298
 
299 299
     /**
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
     private function enumConstraint(): string
308 308
     {
309 309
         if (empty($this->constrainName)) {
310
-            $this->constrainName = $this->table . '_' . $this->getName() . '_enum_' . uniqid();
310
+            $this->constrainName = $this->table.'_'.$this->getName().'_enum_'.uniqid();
311 311
         }
312 312
 
313 313
         return $this->constrainName;
@@ -404,8 +404,8 @@  discard block
 block discarded – undo
404 404
 
405 405
         $constraints = $driver->query($query, [
406 406
             $tableOID,
407
-            '(' . $column->name . '%',
408
-            '("' . $column->name . '%'
407
+            '('.$column->name.'%',
408
+            '("'.$column->name.'%'
409 409
         ]);
410 410
 
411 411
         foreach ($constraints as $constraint) {
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
      */
436 436
     private static function resolveEnum(Driver $driver, PostgresColumn $column)
437 437
     {
438
-        $range = $driver->query('SELECT enum_range(NULL::' . $column->type . ')')->fetchColumn(0);
438
+        $range = $driver->query('SELECT enum_range(NULL::'.$column->type.')')->fetchColumn(0);
439 439
 
440 440
         $column->enumValues = explode(',', substr($range, 1, -1));
441 441
 
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.
source/Spiral/Database/Schemas/Prototypes/AbstractColumn.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
         }
661 661
 
662 662
         if (!empty($enumValues)) {
663
-            return '(' . implode(', ', $enumValues) . ')';
663
+            return '('.implode(', ', $enumValues).')';
664 664
         }
665 665
 
666 666
         return '';
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
             $timestamp = strtotime($value);
726 726
             if ($timestamp === false) {
727 727
                 throw new DefaultValueException(
728
-                    "Unable to normalize value '{$value}' for column type {$type} in " . get_class($this)
728
+                    "Unable to normalize value '{$value}' for column type {$type} in ".get_class($this)
729 729
                 );
730 730
             }
731 731
 
Please login to merge, or discard this patch.