@@ -269,82 +269,82 @@ |
||
269 | 269 | $fields = ''; |
270 | 270 | if (!empty($this->fields)) { |
271 | 271 | if (is_array($this->fields)) { |
272 | - $fields = CreateDefinition::build($this->fields).' '; |
|
272 | + $fields = CreateDefinition::build($this->fields) . ' '; |
|
273 | 273 | } elseif ($this->fields instanceof ArrayObj) { |
274 | 274 | $fields = ArrayObj::build($this->fields); |
275 | 275 | } |
276 | 276 | } |
277 | 277 | if ($this->options->has('DATABASE')) { |
278 | 278 | return 'CREATE ' |
279 | - .OptionsArray::build($this->options).' ' |
|
280 | - .Expression::build($this->name).' ' |
|
279 | + .OptionsArray::build($this->options) . ' ' |
|
280 | + .Expression::build($this->name) . ' ' |
|
281 | 281 | .OptionsArray::build($this->entityOptions); |
282 | 282 | } elseif ($this->options->has('TABLE') && !is_null($this->select)) { |
283 | 283 | return 'CREATE ' |
284 | - .OptionsArray::build($this->options).' ' |
|
285 | - .Expression::build($this->name).' ' |
|
284 | + .OptionsArray::build($this->options) . ' ' |
|
285 | + .Expression::build($this->name) . ' ' |
|
286 | 286 | .$this->select->build(); |
287 | 287 | } elseif ($this->options->has('TABLE') && !is_null($this->like)) { |
288 | 288 | return 'CREATE ' |
289 | - .OptionsArray::build($this->options).' ' |
|
290 | - .Expression::build($this->name).' LIKE ' |
|
289 | + .OptionsArray::build($this->options) . ' ' |
|
290 | + .Expression::build($this->name) . ' LIKE ' |
|
291 | 291 | .Expression::build($this->like); |
292 | 292 | } elseif ($this->options->has('TABLE')) { |
293 | 293 | $partition = ''; |
294 | 294 | |
295 | 295 | if (!empty($this->partitionBy)) { |
296 | - $partition .= "\nPARTITION BY ".$this->partitionBy; |
|
296 | + $partition .= "\nPARTITION BY " . $this->partitionBy; |
|
297 | 297 | } |
298 | 298 | if (!empty($this->partitionsNum)) { |
299 | - $partition .= "\nPARTITIONS ".$this->partitionsNum; |
|
299 | + $partition .= "\nPARTITIONS " . $this->partitionsNum; |
|
300 | 300 | } |
301 | 301 | if (!empty($this->subpartitionBy)) { |
302 | - $partition .= "\nSUBPARTITION BY ".$this->subpartitionBy; |
|
302 | + $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy; |
|
303 | 303 | } |
304 | 304 | if (!empty($this->subpartitionsNum)) { |
305 | - $partition .= "\nSUBPARTITIONS ".$this->subpartitionsNum; |
|
305 | + $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum; |
|
306 | 306 | } |
307 | 307 | if (!empty($this->partitions)) { |
308 | - $partition .= "\n".PartitionDefinition::build($this->partitions); |
|
308 | + $partition .= "\n" . PartitionDefinition::build($this->partitions); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | return 'CREATE ' |
312 | - .OptionsArray::build($this->options).' ' |
|
313 | - .Expression::build($this->name).' ' |
|
312 | + .OptionsArray::build($this->options) . ' ' |
|
313 | + .Expression::build($this->name) . ' ' |
|
314 | 314 | .$fields |
315 | 315 | .OptionsArray::build($this->entityOptions) |
316 | 316 | .$partition; |
317 | 317 | } elseif ($this->options->has('VIEW')) { |
318 | 318 | return 'CREATE ' |
319 | - .OptionsArray::build($this->options).' ' |
|
320 | - .Expression::build($this->name).' ' |
|
321 | - .$fields.' AS '.TokensList::build($this->body).' ' |
|
319 | + .OptionsArray::build($this->options) . ' ' |
|
320 | + .Expression::build($this->name) . ' ' |
|
321 | + .$fields . ' AS ' . TokensList::build($this->body) . ' ' |
|
322 | 322 | .OptionsArray::build($this->entityOptions); |
323 | 323 | } elseif ($this->options->has('TRIGGER')) { |
324 | 324 | return 'CREATE ' |
325 | - .OptionsArray::build($this->options).' ' |
|
326 | - .Expression::build($this->name).' ' |
|
327 | - .OptionsArray::build($this->entityOptions).' ' |
|
328 | - .'ON '.Expression::build($this->table).' ' |
|
329 | - .'FOR EACH ROW '.TokensList::build($this->body); |
|
325 | + .OptionsArray::build($this->options) . ' ' |
|
326 | + .Expression::build($this->name) . ' ' |
|
327 | + .OptionsArray::build($this->entityOptions) . ' ' |
|
328 | + .'ON ' . Expression::build($this->table) . ' ' |
|
329 | + .'FOR EACH ROW ' . TokensList::build($this->body); |
|
330 | 330 | } elseif (($this->options->has('PROCEDURE')) |
331 | 331 | || ($this->options->has('FUNCTION')) |
332 | 332 | ) { |
333 | 333 | $tmp = ''; |
334 | 334 | if ($this->options->has('FUNCTION')) { |
335 | - $tmp = 'RETURNS '.DataType::build($this->return); |
|
335 | + $tmp = 'RETURNS ' . DataType::build($this->return); |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | return 'CREATE ' |
339 | - .OptionsArray::build($this->options).' ' |
|
340 | - .Expression::build($this->name).' ' |
|
341 | - .ParameterDefinition::build($this->parameters).' ' |
|
342 | - .$tmp.' '.TokensList::build($this->body); |
|
339 | + .OptionsArray::build($this->options) . ' ' |
|
340 | + .Expression::build($this->name) . ' ' |
|
341 | + .ParameterDefinition::build($this->parameters) . ' ' |
|
342 | + .$tmp . ' ' . TokensList::build($this->body); |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | return 'CREATE ' |
346 | - .OptionsArray::build($this->options).' ' |
|
347 | - .Expression::build($this->name).' ' |
|
346 | + .OptionsArray::build($this->options) . ' ' |
|
347 | + .Expression::build($this->name) . ' ' |
|
348 | 348 | .TokensList::build($this->body); |
349 | 349 | } |
350 | 350 |
@@ -104,9 +104,9 @@ |
||
104 | 104 | /* |
105 | 105 | * @var SelectStatement $statement |
106 | 106 | */ |
107 | - $ret .= ';'.$statement->build(); |
|
107 | + $ret .= ';' . $statement->build(); |
|
108 | 108 | } |
109 | - $ret .= ';'.$this->end->build(); |
|
109 | + $ret .= ';' . $this->end->build(); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | return $ret; |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | * be ignored. |
195 | 195 | */ |
196 | 196 | if ((($this->status & static::STATUS_COMMENT) == 0) && ($this->query[$i] === '\\')) { |
197 | - $this->current .= $this->query[$i].$this->query[++$i]; |
|
197 | + $this->current .= $this->query[$i] . $this->query[++$i]; |
|
198 | 198 | continue; |
199 | 199 | } |
200 | 200 | |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | // Appending the `DELIMITER` statement that was just |
332 | 332 | // found to the current statement. |
333 | 333 | $ret = trim( |
334 | - $this->current.' '.substr($this->query, $iBak, $i - $iBak) |
|
334 | + $this->current . ' ' . substr($this->query, $iBak, $i - $iBak) |
|
335 | 335 | ); |
336 | 336 | } |
337 | 337 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | */ |
63 | 63 | public static function getParameter($param) |
64 | 64 | { |
65 | - $lexer = new Lexer('('.$param.')'); |
|
65 | + $lexer = new Lexer('(' . $param . ')'); |
|
66 | 66 | |
67 | 67 | // A dummy parser is used for error reporting. |
68 | 68 | $param = ParameterDefinition::parse(new Parser(), $lexer->list); |
@@ -651,13 +651,13 @@ discard block |
||
651 | 651 | } |
652 | 652 | |
653 | 653 | if ($onlyType) { |
654 | - return static::getClause($statement, $list, $old, -1, false).' '. |
|
655 | - $new.' '.static::getClause($statement, $list, $old, 0).' '. |
|
654 | + return static::getClause($statement, $list, $old, -1, false) . ' ' . |
|
655 | + $new . ' ' . static::getClause($statement, $list, $old, 0) . ' ' . |
|
656 | 656 | static::getClause($statement, $list, $old, 1, false); |
657 | 657 | } |
658 | 658 | |
659 | - return static::getClause($statement, $list, $old, -1, false).' '. |
|
660 | - $new.' '.static::getClause($statement, $list, $old, 1, false); |
|
659 | + return static::getClause($statement, $list, $old, -1, false) . ' ' . |
|
660 | + $new . ' ' . static::getClause($statement, $list, $old, 1, false); |
|
661 | 661 | } |
662 | 662 | |
663 | 663 | /** |
@@ -699,15 +699,15 @@ discard block |
||
699 | 699 | } |
700 | 700 | |
701 | 701 | // Adding everything before first replacement. |
702 | - $ret .= static::getClause($statement, $list, $ops[0][0], -1).' '; |
|
702 | + $ret .= static::getClause($statement, $list, $ops[0][0], -1) . ' '; |
|
703 | 703 | |
704 | 704 | // Doing replacements. |
705 | 705 | for ($i = 0; $i < $count; ++$i) { |
706 | - $ret .= $ops[$i][1].' '; |
|
706 | + $ret .= $ops[$i][1] . ' '; |
|
707 | 707 | |
708 | 708 | // Adding everything between this and next replacement. |
709 | 709 | if ($i + 1 !== $count) { |
710 | - $ret .= static::getClause($statement, $list, $ops[$i][0], $ops[$i + 1][0]).' '; |
|
710 | + $ret .= static::getClause($statement, $list, $ops[$i][0], $ops[$i + 1][0]) . ' '; |
|
711 | 711 | } |
712 | 712 | } |
713 | 713 |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | return $ret; |
262 | 262 | case self::TYPE_STRING: |
263 | 263 | $quote = $this->token[0]; |
264 | - $str = str_replace($quote.$quote, $quote, $this->token); |
|
264 | + $str = str_replace($quote . $quote, $quote, $this->token); |
|
265 | 265 | |
266 | 266 | return mb_substr($str, 1, -1, 'UTF-8'); // trims quotes |
267 | 267 | case self::TYPE_SYMBOL: |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | || ($str[0] === '"') || ($str[0] === '\'')) |
281 | 281 | ) { |
282 | 282 | $quote = $str[0]; |
283 | - $str = str_replace($quote.$quote, $quote, $str); |
|
283 | + $str = str_replace($quote . $quote, $quote, $str); |
|
284 | 284 | $str = mb_substr($str, 1, -1, 'UTF-8'); |
285 | 285 | } |
286 | 286 |
@@ -173,12 +173,12 @@ |
||
173 | 173 | |
174 | 174 | // Checking if the name of the clause should be added. |
175 | 175 | if ($type & 2) { |
176 | - $query .= $name.' '; |
|
176 | + $query .= $name . ' '; |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | // Checking if the result of the builder should be added. |
180 | 180 | if ($type & 1) { |
181 | - $query .= $class::build($this->$field).' '; |
|
181 | + $query .= $class::build($this->$field) . ' '; |
|
182 | 182 | } |
183 | 183 | } |
184 | 184 |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $lastToken->token .= $token->token; |
276 | 276 | $lastToken->type = Token::TYPE_SYMBOL; |
277 | 277 | $lastToken->flags = Token::FLAG_SYMBOL_USER; |
278 | - $lastToken->value .= '@'.$token->value; |
|
278 | + $lastToken->value .= '@' . $token->value; |
|
279 | 279 | continue; |
280 | 280 | } elseif (($lastToken !== null) |
281 | 281 | && ($token->type === Token::TYPE_KEYWORD) |
@@ -651,8 +651,8 @@ discard block |
||
651 | 651 | } |
652 | 652 | |
653 | 653 | $iBak = $this->last; |
654 | - $token = $this->str[$this->last].$this->str[++$this->last] |
|
655 | - .$this->str[++$this->last].$this->str[++$this->last]; // _TRUE_ or _FALS_e |
|
654 | + $token = $this->str[$this->last] . $this->str[++$this->last] |
|
655 | + .$this->str[++$this->last] . $this->str[++$this->last]; // _TRUE_ or _FALS_e |
|
656 | 656 | |
657 | 657 | if (Context::isBool($token)) { |
658 | 658 | return new Token($token, Token::TYPE_BOOL); |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | && ((($this->str[$this->last] === $quote) && ($this->str[$this->last + 1] === $quote)) |
829 | 829 | || (($this->str[$this->last] === '\\') && ($quote !== '`'))) |
830 | 830 | ) { |
831 | - $token .= $this->str[$this->last].$this->str[++$this->last]; |
|
831 | + $token .= $this->str[$this->last] . $this->str[++$this->last]; |
|
832 | 832 | } else { |
833 | 833 | if ($this->str[$this->last] === $quote) { |
834 | 834 | break; |
@@ -212,14 +212,14 @@ discard block |
||
212 | 212 | $ret = 'CASE '; |
213 | 213 | if (isset($component->value)) { |
214 | 214 | // Syntax type 0 |
215 | - $ret .= $component->value.' '; |
|
215 | + $ret .= $component->value . ' '; |
|
216 | 216 | for ( |
217 | 217 | $i = 0; |
218 | 218 | $i < count($component->compare_values) && $i < count($component->results); |
219 | 219 | ++$i |
220 | 220 | ) { |
221 | - $ret .= 'WHEN '.$component->compare_values[$i].' '; |
|
222 | - $ret .= 'THEN '.$component->results[$i].' '; |
|
221 | + $ret .= 'WHEN ' . $component->compare_values[$i] . ' '; |
|
222 | + $ret .= 'THEN ' . $component->results[$i] . ' '; |
|
223 | 223 | } |
224 | 224 | } else { |
225 | 225 | // Syntax type 1 |
@@ -228,12 +228,12 @@ discard block |
||
228 | 228 | $i < count($component->conditions) && $i < count($component->results); |
229 | 229 | ++$i |
230 | 230 | ) { |
231 | - $ret .= 'WHEN '.Condition::build($component->conditions[$i]).' '; |
|
232 | - $ret .= 'THEN '.$component->results[$i].' '; |
|
231 | + $ret .= 'WHEN ' . Condition::build($component->conditions[$i]) . ' '; |
|
232 | + $ret .= 'THEN ' . $component->results[$i] . ' '; |
|
233 | 233 | } |
234 | 234 | } |
235 | 235 | if (isset($component->else_result)) { |
236 | - $ret .= 'ELSE '.$component->else_result.' '; |
|
236 | + $ret .= 'ELSE ' . $component->else_result . ' '; |
|
237 | 237 | } |
238 | 238 | $ret .= 'END'; |
239 | 239 |