Completed
Branch feature/pre-split (211a78)
by Anton
05:08
created
source/Spiral/Database/Entities/Schemas/AbstractIndex.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@
 block discarded – undo
162 162
     protected function generateName()
163 163
     {
164 164
         //We can generate name
165
-        $name = $this->table->getName() . '_index_' . implode('_', $this->columns) . '_' . uniqid();
165
+        $name = $this->table->getName().'_index_'.implode('_', $this->columns).'_'.uniqid();
166 166
 
167 167
         if (strlen($name) > 64) {
168 168
             //Many dbs has limitations on identifier length
Please login to merge, or discard this patch.
source/Spiral/Database/Entities/PDODriver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
      */
265 265
     public function identifier($identifier)
266 266
     {
267
-        return $identifier == '*' ? '*' : '"' . str_replace('"', '""', $identifier) . '"';
267
+        return $identifier == '*' ? '*' : '"'.str_replace('"', '""', $identifier).'"';
268 268
     }
269 269
 
270 270
     /**
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
     protected function savepointCreate($name)
588 588
     {
589 589
         $this->logger()->info("Creating savepoint '{$name}'");
590
-        $this->statement('SAVEPOINT ' . $this->identifier("SVP{$name}"));
590
+        $this->statement('SAVEPOINT '.$this->identifier("SVP{$name}"));
591 591
     }
592 592
 
593 593
     /**
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
     protected function savepointRelease($name)
602 602
     {
603 603
         $this->logger()->info("Releasing savepoint '{$name}'");
604
-        $this->statement('RELEASE SAVEPOINT ' . $this->identifier("SVP{$name}"));
604
+        $this->statement('RELEASE SAVEPOINT '.$this->identifier("SVP{$name}"));
605 605
     }
606 606
 
607 607
     /**
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
     protected function savepointRollback($name)
616 616
     {
617 617
         $this->logger()->info("Rolling back savepoint '{$name}'");
618
-        $this->statement('ROLLBACK TO SAVEPOINT ' . $this->identifier("SVP{$name}"));
618
+        $this->statement('ROLLBACK TO SAVEPOINT '.$this->identifier("SVP{$name}"));
619 619
     }
620 620
 
621 621
     /**
Please login to merge, or discard this patch.
source/Spiral/Database/Helpers/QueryInterpolator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -120,16 +120,16 @@
 block discarded – undo
120 120
                 return sprintf('%F', $parameter);
121 121
 
122 122
             case 'string':
123
-                return "'" . addcslashes($parameter, "'") . "'";
123
+                return "'".addcslashes($parameter, "'")."'";
124 124
 
125 125
             case 'object':
126 126
                 if (method_exists($parameter, '__toString')) {
127
-                    return "'" . addcslashes((string)$parameter, "'") . "'";
127
+                    return "'".addcslashes((string)$parameter, "'")."'";
128 128
                 }
129 129
 
130 130
                 if ($parameter instanceof \DateTime) {
131 131
                     //Let's process dates different way
132
-                    return "'" . $parameter->format(\DateTime::ISO8601) . "'";
132
+                    return "'".$parameter->format(\DateTime::ISO8601)."'";
133 133
                 }
134 134
         }
135 135
 
Please login to merge, or discard this patch.
source/Spiral/Database/Builders/Prototypes/AbstractSelect.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
     public function __call($method, $arguments)
405 405
     {
406 406
         if (!in_array($method = strtoupper($method), ['AVG', 'MIN', 'MAX', 'SUM'])) {
407
-            throw new BuilderException("Unknown method '{$method}' in '" . get_class($this) . "'");
407
+            throw new BuilderException("Unknown method '{$method}' in '".get_class($this)."'");
408 408
         }
409 409
 
410 410
         if (!isset($arguments[0]) || count($arguments) > 1) {
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
      */
454 454
     private function havingWrapper()
455 455
     {
456
-        return function ($parameter) {
456
+        return function($parameter) {
457 457
             if ($parameter instanceof FragmentInterface) {
458 458
                 //We are only not creating bindings for plan fragments
459 459
                 if (!$parameter instanceof ParameterInterface && !$parameter instanceof QueryBuilder) {
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/MySQL/Schemas/Commander.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,6 +92,6 @@
 block discarded – undo
92 92
             throw new SchemaException('MySQL commander can process only MySQL tables');
93 93
         }
94 94
 
95
-        return parent::createStatement($table) . " ENGINE {$table->getEngine()}";
95
+        return parent::createStatement($table)." ENGINE {$table->getEngine()}";
96 96
     }
97 97
 }
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/MySQL/QueryCompiler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
         $statement = '';
55 55
         if (!empty($limit) || !empty($offset)) {
56 56
             //When limit is not provided but offset does we can replace limit value with PHP_INT_MAX
57
-            $statement = 'LIMIT ' . ($limit ?: '18446744073709551615') . ' ';
57
+            $statement = 'LIMIT '.($limit ?: '18446744073709551615').' ';
58 58
         }
59 59
 
60 60
         if (!empty($offset)) {
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/SQLServer/Schemas/ColumnSchema.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
                 }
236 236
 
237 237
                 $type = "ALTER COLUMN {$this->getName(true)} varchar($enumSize)";
238
-                $operations[] = $type . ' ' . ($this->nullable ? 'NULL' : 'NOT NULL');
238
+                $operations[] = $type.' '.($this->nullable ? 'NULL' : 'NOT NULL');
239 239
             } else {
240 240
                 $type = "ALTER COLUMN {$this->getName(true)} {$this->type}";
241 241
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
                     $type .= "($this->precision, $this->scale)";
248 248
                 }
249 249
 
250
-                $operations[] = $type . ' ' . ($this->nullable ? 'NULL' : 'NOT NULL');
250
+                $operations[] = $type.' '.($this->nullable ? 'NULL' : 'NOT NULL');
251 251
             }
252 252
         }
253 253
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 
434 434
             //We made some assumptions here...
435 435
             if (preg_match_all(
436
-                '/' . $name . '=[\']?([^\']+)[\']?/i',
436
+                '/'.$name.'=[\']?([^\']+)[\']?/i',
437 437
                 $checkConstraint['definition'],
438 438
                 $matches
439 439
             )) {
@@ -453,6 +453,6 @@  discard block
 block discarded – undo
453 453
      */
454 454
     private function generateName($type)
455 455
     {
456
-        return $this->table->getName() . '_' . $this->getName() . "_{$type}_" . uniqid();
456
+        return $this->table->getName().'_'.$this->getName()."_{$type}_".uniqid();
457 457
     }
458 458
 }
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/Postgres/PostgresInsertQuery.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
             );
38 38
         }
39 39
 
40
-        if ($primary = $driver->getPrimary($this->database->getPrefix() . $this->table)) {
40
+        if ($primary = $driver->getPrimary($this->database->getPrefix().$this->table)) {
41 41
             $this->logger()->debug(
42 42
                 "Primary key '{sequence}' automatically resolved for table '{table}'.",
43 43
                 [
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/Postgres/Schemas/ColumnSchema.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         }
197 197
 
198 198
         return "$statement CONSTRAINT {$this->enumConstraint(true, true)} "
199
-        . "CHECK ({$this->getName(true)} IN (" . implode(', ', $enumValues) . '))';
199
+        . "CHECK ({$this->getName(true)} IN (".implode(', ', $enumValues).'))';
200 200
     }
201 201
 
202 202
     /**
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         }
241 241
 
242 242
         if ($original->abstractType() == 'enum' && !empty($this->enumConstraint)) {
243
-            $operations[] = 'DROP CONSTRAINT ' . $this->enumConstraint(true);
243
+            $operations[] = 'DROP CONSTRAINT '.$this->enumConstraint(true);
244 244
         }
245 245
 
246 246
         if ($original->defaultValue != $this->defaultValue) {
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
         if ($original->nullable != $this->nullable) {
255 255
             $operations[] = "ALTER COLUMN {$this->getName(true)} "
256
-                . (!$this->nullable ? 'SET' : 'DROP') . ' NOT NULL';
256
+                . (!$this->nullable ? 'SET' : 'DROP').' NOT NULL';
257 257
         }
258 258
 
259 259
         if ($this->abstractType() == 'enum') {
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
             }
264 264
 
265 265
             $operations[] = "ADD CONSTRAINT {$this->enumConstraint(true)} "
266
-                . "CHECK ({$this->getName(true)} IN (" . implode(', ', $enumValues) . '))';
266
+                . "CHECK ({$this->getName(true)} IN (".implode(', ', $enumValues).'))';
267 267
         }
268 268
 
269 269
         return $operations;
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
      */
328 328
     protected function prepareEnum()
329 329
     {
330
-        return '(' . $this->size . ')';
330
+        return '('.$this->size.')';
331 331
     }
332 332
 
333 333
     /**
@@ -343,10 +343,10 @@  discard block
 block discarded – undo
343 343
     {
344 344
         if (empty($this->enumConstraint)) {
345 345
             if ($temporary) {
346
-                return $this->table->getName() . '_' . $this->getName() . '_enum';
346
+                return $this->table->getName().'_'.$this->getName().'_enum';
347 347
             }
348 348
 
349
-            $this->enumConstraint = $this->table->getName() . '_' . $this->getName() . '_enum_' . uniqid();
349
+            $this->enumConstraint = $this->table->getName().'_'.$this->getName().'_enum_'.uniqid();
350 350
         }
351 351
 
352 352
         return $quote ? $this->table->driver()->identifier($this->enumConstraint) : $this->enumConstraint;
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
     private function resolveNativeEnum()
378 378
     {
379 379
         $range = $this->table->driver()->query(
380
-            'SELECT enum_range(NULL::' . $this->type . ')'
380
+            'SELECT enum_range(NULL::'.$this->type.')'
381 381
         )->fetchColumn(0);
382 382
 
383 383
         $this->enumValues = explode(',', substr($range, 1, -1));
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
             . "WHERE conrelid = ? AND contype = 'c' AND (consrc LIKE ? OR consrc LIKE ?)";
404 404
 
405 405
         $constraints = $this->table->driver()->query(
406
-            $query, [$tableOID, '(' . $this->name . '%', '("' . $this->name . '%']
406
+            $query, [$tableOID, '('.$this->name.'%', '("'.$this->name.'%']
407 407
         );
408 408
 
409 409
         foreach ($constraints as $constraint) {
Please login to merge, or discard this patch.