Completed
Branch feature/pre-split (c311a2)
by Anton
03:17
created
source/Spiral/Database/Drivers/MySQL/Schemas/ColumnSchema.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@
 block discarded – undo
200 200
 
201 201
         //Fetching enum values
202 202
         if ($column->abstractType() == 'enum' && !empty($options)) {
203
-            $column->enumValues = array_map(function ($value) {
203
+            $column->enumValues = array_map(function($value) {
204 204
                 return trim($value, $value[0]);
205 205
             }, explode(',', $options));
206 206
 
Please login to merge, or discard this patch.
source/Spiral/Database/Schemas/Prototypes/AbstractColumn.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -748,7 +748,7 @@
 block discarded – undo
748 748
         }
749 749
 
750 750
         if (!empty($enumValues)) {
751
-            return '(' . implode(', ', $enumValues) . ')';
751
+            return '('.implode(', ', $enumValues).')';
752 752
         }
753 753
 
754 754
         return '';
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/SQLite/Schemas/ReferenceSchema.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@
 block discarded – undo
21 21
         $statement = [];
22 22
 
23 23
         $statement[] = 'FOREIGN KEY';
24
-        $statement[] = '(' . $driver->identifier($this->column) . ')';
24
+        $statement[] = '('.$driver->identifier($this->column).')';
25 25
 
26
-        $statement[] = 'REFERENCES ' . $driver->identifier($this->foreignTable);
27
-        $statement[] = '(' . $driver->identifier($this->foreignKey) . ')';
26
+        $statement[] = 'REFERENCES '.$driver->identifier($this->foreignTable);
27
+        $statement[] = '('.$driver->identifier($this->foreignKey).')';
28 28
 
29 29
         $statement[] = "ON DELETE {$this->deleteRule}";
30 30
         $statement[] = "ON UPDATE {$this->updateRule}";
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/Postgres/PostgresDriver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
     public function getPrimary(string $prefix, string $table): string
93 93
     {
94 94
         if (!empty($this->cacheStore) && empty($this->primaryKeys)) {
95
-            $this->primaryKeys = (array)$this->cacheStore->get($this->getSource() . '/keys');
95
+            $this->primaryKeys = (array)$this->cacheStore->get($this->getSource().'/keys');
96 96
         }
97 97
 
98 98
         if (!empty($this->primaryKeys) && array_key_exists($table, $this->primaryKeys)) {
99 99
             return $this->primaryKeys[$table];
100 100
         }
101 101
 
102
-        if (!$this->hasTable($prefix . $table)) {
102
+        if (!$this->hasTable($prefix.$table)) {
103 103
             throw new DriverException(
104 104
                 "Unable to fetch table primary key, no such table '{$prefix}{$table}' exists"
105 105
             );
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
         //Caching
117 117
         if (!empty($this->memory)) {
118
-            $this->cacheStore->forever($this->getSource() . '/keys', $this->primaryKeys);
118
+            $this->cacheStore->forever($this->getSource().'/keys', $this->primaryKeys);
119 119
         }
120 120
 
121 121
         return $this->primaryKeys[$table];
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     {
131 131
         return $this->factory->make(
132 132
             PostgresQuery::class,
133
-            ['driver' => $this, 'compiler' => $this->queryCompiler($prefix),] + $parameters
133
+            ['driver' => $this, 'compiler' => $this->queryCompiler($prefix), ] + $parameters
134 134
         );
135 135
     }
136 136
 
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/Schemas/Prototypes/AbstractTable.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
         $this->prefix = $prefix;
103 103
 
104 104
         //Initializing states
105
-        $this->initialState = new TableState($this->prefix . $name);
106
-        $this->currentState = new TableState($this->prefix . $name);
105
+        $this->initialState = new TableState($this->prefix.$name);
106
+        $this->currentState = new TableState($this->prefix.$name);
107 107
 
108 108
         $this->exists = $this->driver->hasTable($this->getName());
109 109
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
      */
171 171
     public function setName(string $name): string
172 172
     {
173
-        $this->currentState->setName($this->prefix . $name);
173
+        $this->currentState->setName($this->prefix.$name);
174 174
 
175 175
         return $this->getName();
176 176
     }
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
     {
436 436
         if (!$this->hasIndex($columns)) {
437 437
             throw new SchemaException(
438
-                "Undefined index ['" . join("', '", $columns) . "'] in '{$this->getName()}'"
438
+                "Undefined index ['".join("', '", $columns)."'] in '{$this->getName()}'"
439 439
             );
440 440
         }
441 441
 
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
     {
495 495
         if (!$this->hasIndex($columns)) {
496 496
             throw new SchemaException(
497
-                "Undefined index ['" . join("', '", $columns) . "'] in '{$this->getName()}'"
497
+                "Undefined index ['".join("', '", $columns)."'] in '{$this->getName()}'"
498 498
             );
499 499
         }
500 500
 
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
      */
670 670
     protected function createIdentifier(string $type, array $columns): string
671 671
     {
672
-        $name = $this->getName() . '_' . $type . '_' . join('_', $columns) . '_' . uniqid();
672
+        $name = $this->getName().'_'.$type.'_'.join('_', $columns).'_'.uniqid();
673 673
 
674 674
         if (strlen($name) > 64) {
675 675
             //Many DBMS has limitations on identifier length
Please login to merge, or discard this patch.