@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $result = "<?php\n"; |
109 | 109 | |
110 | 110 | if (!$this->docComment->isEmpty()) { |
111 | - $result .= $this->docComment->render($indentLevel) . "\n"; |
|
111 | + $result .= $this->docComment->render($indentLevel)."\n"; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | if (!empty($this->namespace)) { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | if (!empty($this->uses)) { |
119 | - $result .= $this->renderUses($indentLevel) . "\n\n"; |
|
119 | + $result .= $this->renderUses($indentLevel)."\n\n"; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | $result .= $this->elements->render($indentLevel); |
@@ -120,16 +120,16 @@ |
||
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 |
@@ -259,7 +259,7 @@ |
||
259 | 259 | /** |
260 | 260 | * {@inheritdoc} |
261 | 261 | */ |
262 | - public function createInjection(\ReflectionClass $class,string $context = null) |
|
262 | + public function createInjection(\ReflectionClass $class, string $context = null) |
|
263 | 263 | { |
264 | 264 | //If context is empty default database will be returned |
265 | 265 | return $this->database($context); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $enumValues[] = $this->table->driver()->getPDO()->quote($value); |
117 | 117 | } |
118 | 118 | |
119 | - return "$statement CHECK ({$this->getName(true)} IN (" . implode(', ', $enumValues) . '))'; |
|
119 | + return "$statement CHECK ({$this->getName(true)} IN (".implode(', ', $enumValues).'))'; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
171 | - $options = array_map(function ($value) { |
|
171 | + $options = array_map(function($value) { |
|
172 | 172 | return intval($value); |
173 | 173 | }, explode(',', $options)); |
174 | 174 |
@@ -22,10 +22,10 @@ |
||
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}"; |
@@ -163,7 +163,7 @@ |
||
163 | 163 | { |
164 | 164 | //Temporary table is required to copy data over |
165 | 165 | $temporary = clone $this; |
166 | - $temporary->setName('spiral_temp_' . $this->getName() . '_' . uniqid()); |
|
166 | + $temporary->setName('spiral_temp_'.$this->getName().'_'.uniqid()); |
|
167 | 167 | |
168 | 168 | //We don't need any index in temporary table |
169 | 169 | foreach ($temporary->getIndexes() as $index) { |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | $selectColumns[] = "? AS {$this->quote($column)}"; |
36 | 36 | } |
37 | 37 | |
38 | - $statement[] = 'SELECT ' . implode(', ', $selectColumns); |
|
38 | + $statement[] = 'SELECT '.implode(', ', $selectColumns); |
|
39 | 39 | } else { |
40 | - $statement[] = 'UNION SELECT ' . trim(str_repeat('?, ', count($columns)), ', '); |
|
40 | + $statement[] = 'UNION SELECT '.trim(str_repeat('?, ', count($columns)), ', '); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $statement = ''; |
59 | 59 | |
60 | 60 | if (!empty($limit) || !empty($offset)) { |
61 | - $statement = 'LIMIT ' . ($limit ?: '-1') . ' '; |
|
61 | + $statement = 'LIMIT '.($limit ?: '-1').' '; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | if (!empty($offset)) { |
@@ -189,14 +189,14 @@ |
||
189 | 189 | if ($this->abstractType() == 'enum') { |
190 | 190 | |
191 | 191 | //Fetching enum values |
192 | - $this->enumValues = array_map(function ($value) { |
|
192 | + $this->enumValues = array_map(function($value) { |
|
193 | 193 | return trim($value, $value[0]); |
194 | 194 | }, explode(',', $options)); |
195 | 195 | |
196 | 196 | return; |
197 | 197 | } |
198 | 198 | |
199 | - $options = array_map(function ($value) { |
|
199 | + $options = array_map(function($value) { |
|
200 | 200 | return intval($value); |
201 | 201 | }, explode(',', $options)); |
202 | 202 |
@@ -92,6 +92,6 @@ |
||
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 | } |