@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | $ret->subquery = $token->value; |
| 229 | 229 | } elseif (($token->flags & Token::FLAG_KEYWORD_FUNCTION) |
| 230 | 230 | && (empty($options['parseField']) |
| 231 | - && ! $alias) |
|
| 231 | + && !$alias) |
|
| 232 | 232 | ) { |
| 233 | 233 | $isExpr = true; |
| 234 | 234 | } elseif (($token->flags & Token::FLAG_KEYWORD_RESERVED) |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | continue; |
| 256 | 256 | } |
| 257 | 257 | $isExpr = true; |
| 258 | - } elseif ($brackets === 0 && count($ret->expr) > 0 && ! $alias) { |
|
| 258 | + } elseif ($brackets === 0 && count($ret->expr) > 0 && !$alias) { |
|
| 259 | 259 | /* End of expression */ |
| 260 | 260 | break; |
| 261 | 261 | } |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | if (!empty($component->alias)) { |
| 436 | - $ret .= ' AS ' . Context::escape($component->alias); |
|
| 436 | + $ret .= ' AS '.Context::escape($component->alias); |
|
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | return $ret; |
@@ -277,80 +277,80 @@ |
||
| 277 | 277 | $fields = ''; |
| 278 | 278 | if (!empty($this->fields)) { |
| 279 | 279 | if (is_array($this->fields)) { |
| 280 | - $fields = CreateDefinition::build($this->fields) . ' '; |
|
| 280 | + $fields = CreateDefinition::build($this->fields).' '; |
|
| 281 | 281 | } elseif ($this->fields instanceof ArrayObj) { |
| 282 | 282 | $fields = ArrayObj::build($this->fields); |
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | 285 | if ($this->options->has('DATABASE')) { |
| 286 | 286 | return 'CREATE ' |
| 287 | - . OptionsArray::build($this->options) . ' ' |
|
| 288 | - . Expression::build($this->name) . ' ' |
|
| 287 | + . OptionsArray::build($this->options).' ' |
|
| 288 | + . Expression::build($this->name).' ' |
|
| 289 | 289 | . OptionsArray::build($this->entityOptions); |
| 290 | 290 | } elseif ($this->options->has('TABLE') && !is_null($this->select)) { |
| 291 | 291 | return 'CREATE ' |
| 292 | - . OptionsArray::build($this->options) . ' ' |
|
| 293 | - . Expression::build($this->name) . ' ' |
|
| 292 | + . OptionsArray::build($this->options).' ' |
|
| 293 | + . Expression::build($this->name).' ' |
|
| 294 | 294 | . $this->select->build(); |
| 295 | 295 | } elseif ($this->options->has('TABLE') && !is_null($this->like)) { |
| 296 | 296 | return 'CREATE ' |
| 297 | - . OptionsArray::build($this->options) . ' ' |
|
| 298 | - . Expression::build($this->name) . ' LIKE ' |
|
| 297 | + . OptionsArray::build($this->options).' ' |
|
| 298 | + . Expression::build($this->name).' LIKE ' |
|
| 299 | 299 | . Expression::build($this->like); |
| 300 | 300 | } elseif ($this->options->has('TABLE')) { |
| 301 | 301 | $partition = ''; |
| 302 | 302 | |
| 303 | 303 | if (!empty($this->partitionBy)) { |
| 304 | - $partition .= "\nPARTITION BY " . $this->partitionBy; |
|
| 304 | + $partition .= "\nPARTITION BY ".$this->partitionBy; |
|
| 305 | 305 | } |
| 306 | 306 | if (!empty($this->partitionsNum)) { |
| 307 | - $partition .= "\nPARTITIONS " . $this->partitionsNum; |
|
| 307 | + $partition .= "\nPARTITIONS ".$this->partitionsNum; |
|
| 308 | 308 | } |
| 309 | 309 | if (!empty($this->subpartitionBy)) { |
| 310 | - $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy; |
|
| 310 | + $partition .= "\nSUBPARTITION BY ".$this->subpartitionBy; |
|
| 311 | 311 | } |
| 312 | 312 | if (!empty($this->subpartitionsNum)) { |
| 313 | - $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum; |
|
| 313 | + $partition .= "\nSUBPARTITIONS ".$this->subpartitionsNum; |
|
| 314 | 314 | } |
| 315 | 315 | if (!empty($this->partitions)) { |
| 316 | - $partition .= "\n" . PartitionDefinition::build($this->partitions); |
|
| 316 | + $partition .= "\n".PartitionDefinition::build($this->partitions); |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | return 'CREATE ' |
| 320 | - . OptionsArray::build($this->options) . ' ' |
|
| 321 | - . Expression::build($this->name) . ' ' |
|
| 320 | + . OptionsArray::build($this->options).' ' |
|
| 321 | + . Expression::build($this->name).' ' |
|
| 322 | 322 | . $fields |
| 323 | 323 | . OptionsArray::build($this->entityOptions) |
| 324 | 324 | . $partition; |
| 325 | 325 | } elseif ($this->options->has('VIEW')) { |
| 326 | 326 | return 'CREATE ' |
| 327 | - . OptionsArray::build($this->options) . ' ' |
|
| 328 | - . Expression::build($this->name) . ' ' |
|
| 329 | - . $fields . ' AS ' . TokensList::build($this->body) . ' ' |
|
| 327 | + . OptionsArray::build($this->options).' ' |
|
| 328 | + . Expression::build($this->name).' ' |
|
| 329 | + . $fields.' AS '.TokensList::build($this->body).' ' |
|
| 330 | 330 | . OptionsArray::build($this->entityOptions); |
| 331 | 331 | } elseif ($this->options->has('TRIGGER')) { |
| 332 | 332 | return 'CREATE ' |
| 333 | - . OptionsArray::build($this->options) . ' ' |
|
| 334 | - . Expression::build($this->name) . ' ' |
|
| 335 | - . OptionsArray::build($this->entityOptions) . ' ' |
|
| 336 | - . 'ON ' . Expression::build($this->table) . ' ' |
|
| 337 | - . 'FOR EACH ROW ' . TokensList::build($this->body); |
|
| 333 | + . OptionsArray::build($this->options).' ' |
|
| 334 | + . Expression::build($this->name).' ' |
|
| 335 | + . OptionsArray::build($this->entityOptions).' ' |
|
| 336 | + . 'ON '.Expression::build($this->table).' ' |
|
| 337 | + . 'FOR EACH ROW '.TokensList::build($this->body); |
|
| 338 | 338 | } elseif (($this->options->has('PROCEDURE')) |
| 339 | 339 | || ($this->options->has('FUNCTION')) |
| 340 | 340 | ) { |
| 341 | 341 | $tmp = ''; |
| 342 | 342 | if ($this->options->has('FUNCTION')) { |
| 343 | - $tmp = 'RETURNS ' . DataType::build($this->return); |
|
| 343 | + $tmp = 'RETURNS '.DataType::build($this->return); |
|
| 344 | 344 | } |
| 345 | 345 | return 'CREATE ' |
| 346 | - . OptionsArray::build($this->options) . ' ' |
|
| 347 | - . Expression::build($this->name) . ' ' |
|
| 348 | - . ParameterDefinition::build($this->parameters) . ' ' |
|
| 349 | - . $tmp . ' ' . TokensList::build($this->body); |
|
| 346 | + . OptionsArray::build($this->options).' ' |
|
| 347 | + . Expression::build($this->name).' ' |
|
| 348 | + . ParameterDefinition::build($this->parameters).' ' |
|
| 349 | + . $tmp.' '.TokensList::build($this->body); |
|
| 350 | 350 | } |
| 351 | 351 | return 'CREATE ' |
| 352 | - . OptionsArray::build($this->options) . ' ' |
|
| 353 | - . Expression::build($this->name) . ' ' |
|
| 352 | + . OptionsArray::build($this->options).' ' |
|
| 353 | + . Expression::build($this->name).' ' |
|
| 354 | 354 | . TokensList::build($this->body); |
| 355 | 355 | } |
| 356 | 356 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | // We have reached the end of ALTER operation and suddenly found |
| 224 | 224 | // a start to new statement, but have not find a delimiter between them |
| 225 | 225 | |
| 226 | - if (! ($token->value == 'SET' && $list->tokens[$list->idx - 1]->value == 'CHARACTER')) { |
|
| 226 | + if (!($token->value == 'SET' && $list->tokens[$list->idx - 1]->value == 'CHARACTER')) { |
|
| 227 | 227 | $parser->error( |
| 228 | 228 | __('A new statement was found, but no delimiter between it and the previous one.'), |
| 229 | 229 | $token |
@@ -255,9 +255,9 @@ discard block |
||
| 255 | 255 | */ |
| 256 | 256 | public static function build($component, array $options = array()) |
| 257 | 257 | { |
| 258 | - $ret = $component->options . ' '; |
|
| 258 | + $ret = $component->options.' '; |
|
| 259 | 259 | if ((isset($component->field)) && ($component->field !== '')) { |
| 260 | - $ret .= $component->field . ' '; |
|
| 260 | + $ret .= $component->field.' '; |
|
| 261 | 261 | } |
| 262 | 262 | $ret .= TokensList::build($component->unknown); |
| 263 | 263 | return $ret; |
@@ -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 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * @var array |
| 33 | 33 | */ |
| 34 | 34 | public static $CLAUSES = array( |
| 35 | - 'SET' => array('SET', 3), |
|
| 35 | + 'SET' => array('SET', 3), |
|
| 36 | 36 | ); |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function build() |
| 68 | 68 | { |
| 69 | - return 'SET ' . OptionsArray::build($this->options) |
|
| 70 | - . ' ' . SetOperation::build($this->set); |
|
| 69 | + return 'SET '.OptionsArray::build($this->options) |
|
| 70 | + . ' '.SetOperation::build($this->set); |
|
| 71 | 71 | } |
| 72 | 72 | } |
@@ -115,19 +115,19 @@ |
||
| 115 | 115 | */ |
| 116 | 116 | public function build() |
| 117 | 117 | { |
| 118 | - $ret = 'INSERT ' . $this->options |
|
| 119 | - . ' INTO ' . $this->into; |
|
| 118 | + $ret = 'INSERT '.$this->options |
|
| 119 | + . ' INTO '.$this->into; |
|
| 120 | 120 | |
| 121 | 121 | if ($this->values != NULL && count($this->values) > 0) { |
| 122 | - $ret .= ' VALUES ' . Array2d::build($this->values); |
|
| 122 | + $ret .= ' VALUES '.Array2d::build($this->values); |
|
| 123 | 123 | } elseif ($this->set != NULL && count($this->set) > 0) { |
| 124 | - $ret .= ' SET ' . SetOperation::build($this->set); |
|
| 124 | + $ret .= ' SET '.SetOperation::build($this->set); |
|
| 125 | 125 | } elseif ($this->select != NULL && count($this->select) > 0) { |
| 126 | - $ret .= ' ' . $this->select->build(); |
|
| 126 | + $ret .= ' '.$this->select->build(); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if ($this->onDuplicateSet != NULL && count($this->onDuplicateSet) > 0) { |
| 130 | - $ret .= ' ON DUPLICATE KEY UPDATE ' . SetOperation::build($this->onDuplicateSet); |
|
| 130 | + $ret .= ' ON DUPLICATE KEY UPDATE '.SetOperation::build($this->onDuplicateSet); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | return $ret; |
@@ -93,15 +93,15 @@ |
||
| 93 | 93 | */ |
| 94 | 94 | public function build() |
| 95 | 95 | { |
| 96 | - $ret = 'REPLACE ' . $this->options |
|
| 97 | - . ' INTO ' . $this->into; |
|
| 96 | + $ret = 'REPLACE '.$this->options |
|
| 97 | + . ' INTO '.$this->into; |
|
| 98 | 98 | |
| 99 | 99 | if ($this->values != NULL && count($this->values) > 0) { |
| 100 | - $ret .= ' VALUES ' . Array2d::build($this->values); |
|
| 100 | + $ret .= ' VALUES '.Array2d::build($this->values); |
|
| 101 | 101 | } elseif ($this->set != NULL && count($this->set) > 0) { |
| 102 | - $ret .= ' SET ' . SetOperation::build($this->set); |
|
| 102 | + $ret .= ' SET '.SetOperation::build($this->set); |
|
| 103 | 103 | } elseif ($this->select != NULL && count($this->select) > 0) { |
| 104 | - $ret .= ' ' . $this->select->build(); |
|
| 104 | + $ret .= ' '.$this->select->build(); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | return $ret; |
@@ -183,7 +183,7 @@ |
||
| 183 | 183 | 'value' => '', |
| 184 | 184 | ); |
| 185 | 185 | $state = 1; |
| 186 | - } elseif ($lastOption[1] === 'expr' || $lastOption[1] === 'expr=') { |
|
| 186 | + } elseif ($lastOption[1] === 'expr' || $lastOption[1] === 'expr=') { |
|
| 187 | 187 | // This is a keyword that is followed by an expression. |
| 188 | 188 | // The expression is used by the specialized parser. |
| 189 | 189 | |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | // pieces only if the clause is not inlined or this fragment |
| 351 | 351 | // is between brackets that are on new line. |
| 352 | 352 | if (((empty(self::$INLINE_CLAUSES[$lastClause])) |
| 353 | - && ! $shortGroup |
|
| 353 | + && !$shortGroup |
|
| 354 | 354 | && ($this->options['parts_newline'])) |
| 355 | 355 | || (end($blocksLineEndings) === true) |
| 356 | 356 | ) { |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | if ($this->options['type'] === 'cli') { |
| 427 | - return $ret . "\x1b[0m"; |
|
| 427 | + return $ret."\x1b[0m"; |
|
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | return $ret; |
@@ -436,9 +436,9 @@ discard block |
||
| 436 | 436 | array( |
| 437 | 437 | "\x00", "\x01", "\x02", "\x03", "\x04", |
| 438 | 438 | "\x05", "\x06", "\x07", "\x08", "\x09", "\x0A", |
| 439 | - "\x0B","\x0C","\x0D", "\x0E", "\x0F", "\x10", "\x11", |
|
| 440 | - "\x12","\x13","\x14","\x15", "\x16", "\x17", "\x18", |
|
| 441 | - "\x19","\x1A","\x1B","\x1C","\x1D", "\x1E", "\x1F" |
|
| 439 | + "\x0B", "\x0C", "\x0D", "\x0E", "\x0F", "\x10", "\x11", |
|
| 440 | + "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", "\x18", |
|
| 441 | + "\x19", "\x1A", "\x1B", "\x1C", "\x1D", "\x1E", "\x1F" |
|
| 442 | 442 | ), |
| 443 | 443 | array( |
| 444 | 444 | '\x00', '\x01', '\x02', '\x03', '\x04', |
@@ -474,9 +474,9 @@ discard block |
||
| 474 | 474 | |
| 475 | 475 | // Formatting HTML. |
| 476 | 476 | if ($this->options['type'] === 'html') { |
| 477 | - return '<span ' . $format['html'] . '>' . htmlspecialchars($text, ENT_NOQUOTES) . '</span>'; |
|
| 477 | + return '<span '.$format['html'].'>'.htmlspecialchars($text, ENT_NOQUOTES).'</span>'; |
|
| 478 | 478 | } elseif ($this->options['type'] === 'cli') { |
| 479 | - return $format['cli'] . $this->escapeConsole($text); |
|
| 479 | + return $format['cli'].$this->escapeConsole($text); |
|
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | break; |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | if ($this->options['type'] === 'cli') { |
| 487 | - return "\x1b[39m" . $this->escapeConsole($text); |
|
| 487 | + return "\x1b[39m".$this->escapeConsole($text); |
|
| 488 | 488 | } elseif ($this->options['type'] === 'html') { |
| 489 | 489 | return htmlspecialchars($text, ENT_NOQUOTES); |
| 490 | 490 | } |