Completed
Branch feature/pre-split (211a78)
by Anton
05:08
created
source/Spiral/Database/Entities/Database.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
             $key = md5(serialize([$query, $parameters, $this->name, $this->prefix]));
263 263
         }
264 264
 
265
-        $data = $store->remember($key, $lifetime, function () use ($query, $parameters) {
265
+        $data = $store->remember($key, $lifetime, function() use ($query, $parameters) {
266 266
             return $this->query($query, $parameters)->fetchAll();
267 267
         });
268 268
 
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
      */
379 379
     public function hasTable($name)
380 380
     {
381
-        return $this->driver->hasTable($this->prefix . $name);
381
+        return $this->driver->hasTable($this->prefix.$name);
382 382
     }
383 383
 
384 384
     /**
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@
 block discarded – undo
200 200
      * @param string $class Class to be used to represent PDOStatement.
201 201
      * @param array  $args  Class construction arguments, by default array of parameters.
202 202
      *
203
-     * @return ResultInterface|\PDOStatement|PDOQuery
203
+     * @return PDOQuery
204 204
      */
205 205
     public function query($query, array $parameters = [], $class = null, array $args = [])
206 206
     {
Please login to merge, or discard this patch.
source/Spiral/Database/Entities/Schemas/AbstractTable.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@
 block discarded – undo
164 164
      */
165 165
     public function setName($name)
166 166
     {
167
-        parent::setName($this->prefix . $name);
167
+        parent::setName($this->prefix.$name);
168 168
     }
169 169
 
170 170
     /**
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -161,6 +161,7 @@  discard block
 block discarded – undo
161 161
      * {@inheritdoc}
162 162
      *
163 163
      * Automatically forces prefix value.
164
+     * @param string $name
164 165
      */
165 166
     public function setName($name)
166 167
     {
@@ -279,7 +280,7 @@  discard block
 block discarded – undo
279 280
      * $table->unique(['key', 'key2']);
280 281
      *
281 282
      * @param mixed $columns Column name, or array of columns.
282
-     * @return AbstractColumn|null
283
+     * @return AbstractIndex
283 284
      */
284 285
     public function unique($columns)
285 286
     {
Please login to merge, or discard this patch.
source/Spiral/Database/Entities/Schemas/AbstractReference.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      */
163 163
     public function references($table, $column = 'id')
164 164
     {
165
-        $this->foreignTable = $this->table->getPrefix() . $table;
165
+        $this->foreignTable = $this->table->getPrefix().$table;
166 166
         $this->foreignKey = $column;
167 167
 
168 168
         return $this;
@@ -206,10 +206,10 @@  discard block
 block discarded – undo
206 206
         $statement[] = 'CONSTRAINT';
207 207
         $statement[] = $this->getName(true);
208 208
         $statement[] = 'FOREIGN KEY';
209
-        $statement[] = '(' . $this->table->driver()->identifier($this->column) . ')';
209
+        $statement[] = '('.$this->table->driver()->identifier($this->column).')';
210 210
 
211
-        $statement[] = 'REFERENCES ' . $this->table->driver()->identifier($this->foreignTable);
212
-        $statement[] = '(' . $this->table->driver()->identifier($this->foreignKey) . ')';
211
+        $statement[] = 'REFERENCES '.$this->table->driver()->identifier($this->foreignTable);
212
+        $statement[] = '('.$this->table->driver()->identifier($this->foreignKey).')';
213 213
 
214 214
         $statement[] = "ON DELETE {$this->deleteRule}";
215 215
         $statement[] = "ON UPDATE {$this->updateRule}";
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
      */
239 239
     protected function generateName()
240 240
     {
241
-        $name = $this->table->getName() . '_foreign_' . $this->column . '_' . uniqid();
241
+        $name = $this->table->getName().'_foreign_'.$this->column.'_'.uniqid();
242 242
 
243 243
         if (strlen($name) > 64) {
244 244
             //Many dbs has limitations on identifier length
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/MySQL/MySQLDriver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
      */
58 58
     public function identifier($identifier)
59 59
     {
60
-        return $identifier == '*' ? '*' : '`' . str_replace('`', '``', $identifier) . '`';
60
+        return $identifier == '*' ? '*' : '`'.str_replace('`', '``', $identifier).'`';
61 61
     }
62 62
 
63 63
     /**
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/Postgres/PostgresDriver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     public function getPrimary($table)
118 118
     {
119 119
         if (!empty($this->memory) && empty($this->primaryKeys)) {
120
-            $this->primaryKeys = (array)$this->memory->loadData($this->getSource() . '-primary');
120
+            $this->primaryKeys = (array)$this->memory->loadData($this->getSource().'-primary');
121 121
         }
122 122
 
123 123
         if (!empty($this->primaryKeys) && array_key_exists($table, $this->primaryKeys)) {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
         //Caching
142 142
         if (!empty($this->memory)) {
143
-            $this->memory->saveData($this->getSource() . '-primary', $this->primaryKeys);
143
+            $this->memory->saveData($this->getSource().'-primary', $this->primaryKeys);
144 144
         }
145 145
 
146 146
         return $this->primaryKeys[$table];
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/SQLServer/QueryCompiler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
137 137
         $offset = $offset + 1;
138 138
 
139 139
         if (!empty($limit)) {
140
-            $statement .= "BETWEEN {$offset} AND " . ($offset + $limit - 1);
140
+            $statement .= "BETWEEN {$offset} AND ".($offset + $limit - 1);
141 141
         } else {
142 142
             $statement .= ">= {$offset}";
143 143
         }
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/SQLServer/SQLServerDriver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
      */
85 85
     public function identifier($identifier)
86 86
     {
87
-        return $identifier == '*' ? '*' : '[' . str_replace('[', '[[', $identifier) . ']';
87
+        return $identifier == '*' ? '*' : '['.str_replace('[', '[[', $identifier).']';
88 88
     }
89 89
 
90 90
     /**
Please login to merge, or discard this patch.
source/Spiral/Database/Drivers/SQLServer/Schemas/Commander.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         if ($column->getName() != $initial->getName()) {
67 67
             //Renaming is separate operation
68 68
             $this->run("sp_rename ?, ?, 'COLUMN'", [
69
-                $table->getName() . '.' . $initial->getName(),
69
+                $table->getName().'.'.$initial->getName(),
70 70
                 $column->getName()
71 71
             ]);
72 72
         }
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
@@ -22,10 +22,10 @@
 block discarded – undo
22 22
         $statement = [];
23 23
 
24 24
         $statement[] = 'FOREIGN KEY';
25
-        $statement[] = '(' . $this->table->driver()->identifier($this->column) . ')';
25
+        $statement[] = '('.$this->table->driver()->identifier($this->column).')';
26 26
 
27
-        $statement[] = 'REFERENCES ' . $this->table->driver()->identifier($this->foreignTable);
28
-        $statement[] = '(' . $this->table->driver()->identifier($this->foreignKey) . ')';
27
+        $statement[] = 'REFERENCES '.$this->table->driver()->identifier($this->foreignTable);
28
+        $statement[] = '('.$this->table->driver()->identifier($this->foreignKey).')';
29 29
 
30 30
         $statement[] = "ON DELETE {$this->deleteRule}";
31 31
         $statement[] = "ON UPDATE {$this->updateRule}";
Please login to merge, or discard this patch.