@@ -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 | } |
@@ -30,14 +30,14 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @var int |
32 | 32 | */ |
33 | - const TYPE_NONE = 0; |
|
33 | + const TYPE_NONE = 0; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * SQL specific keywords: SELECT, UPDATE, INSERT, etc. |
37 | 37 | * |
38 | 38 | * @var int |
39 | 39 | */ |
40 | - const TYPE_KEYWORD = 1; |
|
40 | + const TYPE_KEYWORD = 1; |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Any type of legal operator. |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | * |
52 | 52 | * @var int |
53 | 53 | */ |
54 | - const TYPE_OPERATOR = 2; |
|
54 | + const TYPE_OPERATOR = 2; |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * Spaces, tabs, new lines, etc. |
58 | 58 | * |
59 | 59 | * @var int |
60 | 60 | */ |
61 | - const TYPE_WHITESPACE = 3; |
|
61 | + const TYPE_WHITESPACE = 3; |
|
62 | 62 | |
63 | 63 | /** |
64 | 64 | * Any type of legal comment. |
@@ -80,21 +80,21 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @var int |
82 | 82 | */ |
83 | - const TYPE_COMMENT = 4; |
|
83 | + const TYPE_COMMENT = 4; |
|
84 | 84 | |
85 | 85 | /** |
86 | 86 | * Boolean values: true or false. |
87 | 87 | * |
88 | 88 | * @var int |
89 | 89 | */ |
90 | - const TYPE_BOOL = 5; |
|
90 | + const TYPE_BOOL = 5; |
|
91 | 91 | |
92 | 92 | /** |
93 | 93 | * Numbers: 4, 0x8, 15.16, 23e42, etc. |
94 | 94 | * |
95 | 95 | * @var int |
96 | 96 | */ |
97 | - const TYPE_NUMBER = 6; |
|
97 | + const TYPE_NUMBER = 6; |
|
98 | 98 | |
99 | 99 | /** |
100 | 100 | * Literal strings: 'string', "test". |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * |
103 | 103 | * @var int |
104 | 104 | */ |
105 | - const TYPE_STRING = 7; |
|
105 | + const TYPE_STRING = 7; |
|
106 | 106 | |
107 | 107 | /** |
108 | 108 | * Database, table names, variables, etc. |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * |
111 | 111 | * @var int |
112 | 112 | */ |
113 | - const TYPE_SYMBOL = 8; |
|
113 | + const TYPE_SYMBOL = 8; |
|
114 | 114 | |
115 | 115 | /** |
116 | 116 | * Delimits an unknown string. |
@@ -118,46 +118,46 @@ discard block |
||
118 | 118 | * |
119 | 119 | * @var int |
120 | 120 | */ |
121 | - const TYPE_DELIMITER = 9; |
|
121 | + const TYPE_DELIMITER = 9; |
|
122 | 122 | |
123 | 123 | // Flags that describe the tokens in more detail. |
124 | 124 | // All keywords must have flag 1 so `Context::isKeyword` method doesn't |
125 | 125 | // require strict comparison. |
126 | - const FLAG_KEYWORD_RESERVED = 2; |
|
127 | - const FLAG_KEYWORD_COMPOSED = 4; |
|
128 | - const FLAG_KEYWORD_DATA_TYPE = 8; |
|
126 | + const FLAG_KEYWORD_RESERVED = 2; |
|
127 | + const FLAG_KEYWORD_COMPOSED = 4; |
|
128 | + const FLAG_KEYWORD_DATA_TYPE = 8; |
|
129 | 129 | const FLAG_KEYWORD_KEY = 16; |
130 | 130 | const FLAG_KEYWORD_FUNCTION = 32; |
131 | 131 | |
132 | 132 | // Numbers related flags. |
133 | - const FLAG_NUMBER_HEX = 1; |
|
134 | - const FLAG_NUMBER_FLOAT = 2; |
|
135 | - const FLAG_NUMBER_APPROXIMATE = 4; |
|
136 | - const FLAG_NUMBER_NEGATIVE = 8; |
|
133 | + const FLAG_NUMBER_HEX = 1; |
|
134 | + const FLAG_NUMBER_FLOAT = 2; |
|
135 | + const FLAG_NUMBER_APPROXIMATE = 4; |
|
136 | + const FLAG_NUMBER_NEGATIVE = 8; |
|
137 | 137 | const FLAG_NUMBER_BINARY = 16; |
138 | 138 | |
139 | 139 | // Strings related flags. |
140 | - const FLAG_STRING_SINGLE_QUOTES = 1; |
|
141 | - const FLAG_STRING_DOUBLE_QUOTES = 2; |
|
140 | + const FLAG_STRING_SINGLE_QUOTES = 1; |
|
141 | + const FLAG_STRING_DOUBLE_QUOTES = 2; |
|
142 | 142 | |
143 | 143 | // Comments related flags. |
144 | - const FLAG_COMMENT_BASH = 1; |
|
145 | - const FLAG_COMMENT_C = 2; |
|
146 | - const FLAG_COMMENT_SQL = 4; |
|
147 | - const FLAG_COMMENT_MYSQL_CMD = 8; |
|
144 | + const FLAG_COMMENT_BASH = 1; |
|
145 | + const FLAG_COMMENT_C = 2; |
|
146 | + const FLAG_COMMENT_SQL = 4; |
|
147 | + const FLAG_COMMENT_MYSQL_CMD = 8; |
|
148 | 148 | |
149 | 149 | // Operators related flags. |
150 | - const FLAG_OPERATOR_ARITHMETIC = 1; |
|
151 | - const FLAG_OPERATOR_LOGICAL = 2; |
|
152 | - const FLAG_OPERATOR_BITWISE = 4; |
|
153 | - const FLAG_OPERATOR_ASSIGNMENT = 8; |
|
150 | + const FLAG_OPERATOR_ARITHMETIC = 1; |
|
151 | + const FLAG_OPERATOR_LOGICAL = 2; |
|
152 | + const FLAG_OPERATOR_BITWISE = 4; |
|
153 | + const FLAG_OPERATOR_ASSIGNMENT = 8; |
|
154 | 154 | const FLAG_OPERATOR_SQL = 16; |
155 | 155 | |
156 | 156 | // Symbols related flags. |
157 | - const FLAG_SYMBOL_VARIABLE = 1; |
|
158 | - const FLAG_SYMBOL_BACKTICK = 2; |
|
159 | - const FLAG_SYMBOL_USER = 4; |
|
160 | - const FLAG_SYMBOL_SYSTEM = 8; |
|
157 | + const FLAG_SYMBOL_VARIABLE = 1; |
|
158 | + const FLAG_SYMBOL_BACKTICK = 2; |
|
159 | + const FLAG_SYMBOL_USER = 4; |
|
160 | + const FLAG_SYMBOL_SYSTEM = 8; |
|
161 | 161 | |
162 | 162 | /** |
163 | 163 | * The token it its raw string representation. |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | return $ret; |
251 | 251 | case Token::TYPE_STRING: |
252 | 252 | $quote = $this->token[0]; |
253 | - $str = str_replace($quote . $quote, $quote, $this->token); |
|
253 | + $str = str_replace($quote.$quote, $quote, $this->token); |
|
254 | 254 | return mb_substr($str, 1, -1, 'UTF-8'); // trims quotes |
255 | 255 | case Token::TYPE_SYMBOL: |
256 | 256 | $str = $this->token; |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | || ($str[0] === '"') || ($str[0] === '\'')) |
269 | 269 | ) { |
270 | 270 | $quote = $str[0]; |
271 | - $str = str_replace($quote . $quote, $quote, $str); |
|
271 | + $str = str_replace($quote.$quote, $quote, $str); |
|
272 | 272 | $str = mb_substr($str, 1, -1, 'UTF-8'); |
273 | 273 | } |
274 | 274 | return $str; |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | public static function build($component, array $options = array()) |
289 | 289 | { |
290 | 290 | if (is_array($component)) { |
291 | - return "(\n " . implode(",\n ", $component) . "\n)"; |
|
291 | + return "(\n ".implode(",\n ", $component)."\n)"; |
|
292 | 292 | } else { |
293 | 293 | $tmp = ''; |
294 | 294 | |
@@ -297,22 +297,22 @@ discard block |
||
297 | 297 | } |
298 | 298 | |
299 | 299 | if ((isset($component->name)) && ($component->name !== '')) { |
300 | - $tmp .= Context::escape($component->name) . ' '; |
|
300 | + $tmp .= Context::escape($component->name).' '; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | if (!empty($component->type)) { |
304 | 304 | $tmp .= DataType::build( |
305 | 305 | $component->type, |
306 | 306 | array('lowercase' => true) |
307 | - ) . ' '; |
|
307 | + ).' '; |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | if (!empty($component->key)) { |
311 | - $tmp .= $component->key . ' '; |
|
311 | + $tmp .= $component->key.' '; |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | if (!empty($component->references)) { |
315 | - $tmp .= 'REFERENCES ' . $component->references . ' '; |
|
315 | + $tmp .= 'REFERENCES '.$component->references.' '; |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | $tmp .= $component->options; |
@@ -120,6 +120,6 @@ |
||
120 | 120 | */ |
121 | 121 | public static function build($component, array $options = array()) |
122 | 122 | { |
123 | - return $component->name . $component->parameters; |
|
123 | + return $component->name.$component->parameters; |
|
124 | 124 | } |
125 | 125 | } |
@@ -139,10 +139,10 @@ |
||
139 | 139 | { |
140 | 140 | if ($component->dest instanceof Expression) { |
141 | 141 | $columns = !empty($component->columns) ? |
142 | - '(' . implode(', ', $component->columns) . ')' : ''; |
|
143 | - return $component->dest . $columns; |
|
142 | + '('.implode(', ', $component->columns).')' : ''; |
|
143 | + return $component->dest.$columns; |
|
144 | 144 | } else { |
145 | - return 'OUTFILE "' . $component->dest . '"'; |
|
145 | + return 'OUTFILE "'.$component->dest.'"'; |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | { |
34 | 34 | $tmp = array(); |
35 | 35 | foreach ($component as $component) { |
36 | - $tmp[] = $component[0] . ' ' . $component[1]; |
|
36 | + $tmp[] = $component[0].' '.$component[1]; |
|
37 | 37 | } |
38 | 38 | return implode(' ', $tmp); |
39 | 39 | } |
@@ -132,7 +132,7 @@ |
||
132 | 132 | if (is_array($component)) { |
133 | 133 | return implode(', ', $component); |
134 | 134 | } else { |
135 | - return $component->column . ' = ' . $component->value; |
|
135 | + return $component->column.' = '.$component->value; |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 | } |
@@ -168,7 +168,7 @@ |
||
168 | 168 | if (is_array($component)) { |
169 | 169 | return implode(', ', $component); |
170 | 170 | } else { |
171 | - return $component->old . ' TO ' . $component->new; |
|
171 | + return $component->old.' TO '.$component->new; |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | } |