@@ -52,14 +52,14 @@ |
||
52 | 52 | * @var array |
53 | 53 | */ |
54 | 54 | public static $CLAUSES = array( |
55 | - 'DELETE' => array('DELETE', 2), |
|
55 | + 'DELETE' => array('DELETE', 2), |
|
56 | 56 | // Used for options. |
57 | - '_OPTIONS' => array('_OPTIONS', 1), |
|
58 | - 'FROM' => array('FROM', 3), |
|
59 | - 'PARTITION' => array('PARTITION', 3), |
|
60 | - 'WHERE' => array('WHERE', 3), |
|
61 | - 'ORDER BY' => array('ORDER BY', 3), |
|
62 | - 'LIMIT' => array('LIMIT', 3), |
|
57 | + '_OPTIONS' => array('_OPTIONS', 1), |
|
58 | + 'FROM' => array('FROM', 3), |
|
59 | + 'PARTITION' => array('PARTITION', 3), |
|
60 | + 'WHERE' => array('WHERE', 3), |
|
61 | + 'ORDER BY' => array('ORDER BY', 3), |
|
62 | + 'LIMIT' => array('LIMIT', 3), |
|
63 | 63 | ); |
64 | 64 | |
65 | 65 | /** |
@@ -83,30 +83,30 @@ |
||
83 | 83 | * @var array |
84 | 84 | */ |
85 | 85 | public static $CLAUSES = array( |
86 | - 'SELECT' => array('SELECT', 2), |
|
86 | + 'SELECT' => array('SELECT', 2), |
|
87 | 87 | // Used for options. |
88 | - '_OPTIONS' => array('_OPTIONS', 1), |
|
88 | + '_OPTIONS' => array('_OPTIONS', 1), |
|
89 | 89 | // Used for selected expressions. |
90 | - '_SELECT' => array('SELECT', 1), |
|
91 | - 'FROM' => array('FROM', 3), |
|
92 | - 'PARTITION' => array('PARTITION', 3), |
|
93 | - |
|
94 | - 'JOIN' => array('JOIN', 1), |
|
95 | - 'FULL JOIN' => array('FULL JOIN', 1), |
|
96 | - 'INNER JOIN' => array('INNER JOIN', 1), |
|
97 | - 'LEFT JOIN' => array('LEFT JOIN', 1), |
|
98 | - 'LEFT OUTER JOIN' => array('LEFT OUTER JOIN', 1), |
|
99 | - 'RIGHT JOIN' => array('RIGHT JOIN', 1), |
|
100 | - 'RIGHT OUTER JOIN' => array('RIGHT OUTER JOIN', 1), |
|
101 | - |
|
102 | - 'WHERE' => array('WHERE', 3), |
|
103 | - 'GROUP BY' => array('GROUP BY', 3), |
|
104 | - 'HAVING' => array('HAVING', 3), |
|
105 | - 'ORDER BY' => array('ORDER BY', 3), |
|
106 | - 'LIMIT' => array('LIMIT', 3), |
|
107 | - 'PROCEDURE' => array('PROCEDURE', 3), |
|
108 | - 'INTO' => array('INTO', 3), |
|
109 | - 'UNION' => array('UNION', 1), |
|
90 | + '_SELECT' => array('SELECT', 1), |
|
91 | + 'FROM' => array('FROM', 3), |
|
92 | + 'PARTITION' => array('PARTITION', 3), |
|
93 | + |
|
94 | + 'JOIN' => array('JOIN', 1), |
|
95 | + 'FULL JOIN' => array('FULL JOIN', 1), |
|
96 | + 'INNER JOIN' => array('INNER JOIN', 1), |
|
97 | + 'LEFT JOIN' => array('LEFT JOIN', 1), |
|
98 | + 'LEFT OUTER JOIN' => array('LEFT OUTER JOIN', 1), |
|
99 | + 'RIGHT JOIN' => array('RIGHT JOIN', 1), |
|
100 | + 'RIGHT OUTER JOIN' => array('RIGHT OUTER JOIN', 1), |
|
101 | + |
|
102 | + 'WHERE' => array('WHERE', 3), |
|
103 | + 'GROUP BY' => array('GROUP BY', 3), |
|
104 | + 'HAVING' => array('HAVING', 3), |
|
105 | + 'ORDER BY' => array('ORDER BY', 3), |
|
106 | + 'LIMIT' => array('LIMIT', 3), |
|
107 | + 'PROCEDURE' => array('PROCEDURE', 3), |
|
108 | + 'INTO' => array('INTO', 3), |
|
109 | + 'UNION' => array('UNION', 1), |
|
110 | 110 | // These are available only when `UNION` is present. |
111 | 111 | // 'ORDER BY' => array('ORDER BY', 3), |
112 | 112 | // 'LIMIT' => array('LIMIT', 3), |
@@ -57,15 +57,15 @@ |
||
57 | 57 | * @var array |
58 | 58 | */ |
59 | 59 | public static $CLAUSES = array( |
60 | - 'UPDATE' => array('UPDATE', 2), |
|
60 | + 'UPDATE' => array('UPDATE', 2), |
|
61 | 61 | // Used for options. |
62 | - '_OPTIONS' => array('_OPTIONS', 1), |
|
62 | + '_OPTIONS' => array('_OPTIONS', 1), |
|
63 | 63 | // Used for updated tables. |
64 | - '_UPDATE' => array('UPDATE', 1), |
|
65 | - 'SET' => array('SET', 3), |
|
66 | - 'WHERE' => array('WHERE', 3), |
|
67 | - 'ORDER BY' => array('ORDER BY', 3), |
|
68 | - 'LIMIT' => array('LIMIT', 3), |
|
64 | + '_UPDATE' => array('UPDATE', 1), |
|
65 | + 'SET' => array('SET', 3), |
|
66 | + 'WHERE' => array('WHERE', 3), |
|
67 | + 'ORDER BY' => array('ORDER BY', 3), |
|
68 | + 'LIMIT' => array('LIMIT', 3), |
|
69 | 69 | ); |
70 | 70 | |
71 | 71 | /** |
@@ -54,12 +54,12 @@ |
||
54 | 54 | * @var array |
55 | 55 | */ |
56 | 56 | public static $CLAUSES = array( |
57 | - 'DROP' => array('DROP', 2), |
|
57 | + 'DROP' => array('DROP', 2), |
|
58 | 58 | // Used for options. |
59 | - '_OPTIONS' => array('_OPTIONS', 1), |
|
59 | + '_OPTIONS' => array('_OPTIONS', 1), |
|
60 | 60 | // Used for select expressions. |
61 | - 'DROP_' => array('DROP', 1), |
|
62 | - 'ON' => array('ON', 3), |
|
61 | + 'DROP_' => array('DROP', 1), |
|
62 | + 'ON' => array('ON', 3), |
|
63 | 63 | ); |
64 | 64 | |
65 | 65 | /** |
@@ -36,10 +36,10 @@ |
||
36 | 36 | $params[$value[0]] = $params[$value]; |
37 | 37 | } |
38 | 38 | } |
39 | - if (! isset($params['f'])) { |
|
39 | + if (!isset($params['f'])) { |
|
40 | 40 | $params['f'] = 'cli'; |
41 | 41 | } |
42 | - if (! in_array($params['f'], array('html', 'cli', 'text'))) { |
|
42 | + if (!in_array($params['f'], array('html', 'cli', 'text'))) { |
|
43 | 43 | return false; |
44 | 44 | } |
45 | 45 | return $params; |
@@ -67,7 +67,7 @@ |
||
67 | 67 | */ |
68 | 68 | public static function getParameter($param) |
69 | 69 | { |
70 | - $lexer = new Lexer('(' . $param . ')'); |
|
70 | + $lexer = new Lexer('('.$param.')'); |
|
71 | 71 | |
72 | 72 | // A dummy parser is used for error reporting. |
73 | 73 | $param = ParameterDefinition::parse(new Parser(), $lexer->list); |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | * be ignored. |
201 | 201 | */ |
202 | 202 | if ((($this->status & static::STATUS_COMMENT) == 0) && ($this->query[$i] === '\\')) { |
203 | - $this->current .= $this->query[$i] . $this->query[++$i]; |
|
203 | + $this->current .= $this->query[$i].$this->query[++$i]; |
|
204 | 204 | continue; |
205 | 205 | } |
206 | 206 | |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | * statement. This is the reason for the last condition. |
296 | 296 | */ |
297 | 297 | if (($i + 9 < $len) |
298 | - && (($this->query[$i ] === 'D') || ($this->query[$i ] === 'd')) |
|
298 | + && (($this->query[$i] === 'D') || ($this->query[$i] === 'd')) |
|
299 | 299 | && (($this->query[$i + 1] === 'E') || ($this->query[$i + 1] === 'e')) |
300 | 300 | && (($this->query[$i + 2] === 'L') || ($this->query[$i + 2] === 'l')) |
301 | 301 | && (($this->query[$i + 3] === 'I') || ($this->query[$i + 3] === 'i')) |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | // Appending the `DELIMITER` statement that was just |
338 | 338 | // found to the current statement. |
339 | 339 | $ret = trim( |
340 | - $this->current . ' ' . substr($this->query, $iBak, $i - $iBak) |
|
340 | + $this->current.' '.substr($this->query, $iBak, $i - $iBak) |
|
341 | 341 | ); |
342 | 342 | } |
343 | 343 |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | // pieces only if the clause is not inlined or this fragment |
347 | 347 | // is between brackets that are on new line. |
348 | 348 | if (((empty(self::$INLINE_CLAUSES[$lastClause])) |
349 | - && ! $shortGroup |
|
349 | + && !$shortGroup |
|
350 | 350 | && ($this->options['parts_newline'])) |
351 | 351 | || (end($blocksLineEndings) === true) |
352 | 352 | ) { |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | } |
421 | 421 | |
422 | 422 | if ($this->options['type'] === 'cli') { |
423 | - return $ret . "\e[0m"; |
|
423 | + return $ret."\e[0m"; |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | return $ret; |
@@ -449,9 +449,9 @@ discard block |
||
449 | 449 | |
450 | 450 | // Formatting HTML. |
451 | 451 | if ($this->options['type'] === 'html') { |
452 | - return '<span ' . $format['html'] . '>' . $text . '</span>'; |
|
452 | + return '<span '.$format['html'].'>'.$text.'</span>'; |
|
453 | 453 | } elseif ($this->options['type'] === 'cli') { |
454 | - return $format['cli'] . $text; |
|
454 | + return $format['cli'].$text; |
|
455 | 455 | } |
456 | 456 | |
457 | 457 | break; |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | } |
460 | 460 | |
461 | 461 | if ($this->options['type'] === 'cli') { |
462 | - return "\e[39m" . $text; |
|
462 | + return "\e[39m".$text; |
|
463 | 463 | } |
464 | 464 | return $text; |
465 | 465 | } |
@@ -658,13 +658,13 @@ discard block |
||
658 | 658 | } |
659 | 659 | |
660 | 660 | if ($onlyType) { |
661 | - return static::getClause($statement, $list, $old, -1, false) . ' ' . |
|
662 | - $new . ' ' . static::getClause($statement, $list, $old, 0) . ' ' . |
|
661 | + return static::getClause($statement, $list, $old, -1, false).' '. |
|
662 | + $new.' '.static::getClause($statement, $list, $old, 0).' '. |
|
663 | 663 | static::getClause($statement, $list, $old, 1, false); |
664 | 664 | } |
665 | 665 | |
666 | - return static::getClause($statement, $list, $old, -1, false) . ' ' . |
|
667 | - $new . ' ' . static::getClause($statement, $list, $old, 1, false); |
|
666 | + return static::getClause($statement, $list, $old, -1, false).' '. |
|
667 | + $new.' '.static::getClause($statement, $list, $old, 1, false); |
|
668 | 668 | } |
669 | 669 | |
670 | 670 | /** |
@@ -706,15 +706,15 @@ discard block |
||
706 | 706 | } |
707 | 707 | |
708 | 708 | // Adding everything before first replacement. |
709 | - $ret .= static::getClause($statement, $list, $ops[0][0], -1) . ' '; |
|
709 | + $ret .= static::getClause($statement, $list, $ops[0][0], -1).' '; |
|
710 | 710 | |
711 | 711 | // Doing replacements. |
712 | 712 | for ($i = 0; $i < $count; ++$i) { |
713 | - $ret .= $ops[$i][1] . ' '; |
|
713 | + $ret .= $ops[$i][1].' '; |
|
714 | 714 | |
715 | 715 | // Adding everything between this and next replacement. |
716 | 716 | if ($i + 1 !== $count) { |
717 | - $ret .= static::getClause($statement, $list, $ops[$i][0], $ops[$i + 1][0]) . ' '; |
|
717 | + $ret .= static::getClause($statement, $list, $ops[$i][0], $ops[$i + 1][0]).' '; |
|
718 | 718 | } |
719 | 719 | } |
720 | 720 |