@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | * |
| 281 | 281 | * Used by all `CREATE` statements. |
| 282 | 282 | */ |
| 283 | - public Expression|null $name = null; |
|
| 283 | + public Expression | null $name = null; |
|
| 284 | 284 | |
| 285 | 285 | /** |
| 286 | 286 | * The options of the entity (table, procedure, function, etc.). |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | public function build(): string |
| 410 | 410 | { |
| 411 | 411 | $fields = ''; |
| 412 | - if (! empty($this->fields)) { |
|
| 412 | + if (!empty($this->fields)) { |
|
| 413 | 413 | if (is_array($this->fields)) { |
| 414 | 414 | $fields = CreateDefinition::build($this->fields) . ' '; |
| 415 | 415 | } elseif ($this->fields instanceof ArrayObj) { |
@@ -448,23 +448,23 @@ discard block |
||
| 448 | 448 | |
| 449 | 449 | $partition = ''; |
| 450 | 450 | |
| 451 | - if (! empty($this->partitionBy)) { |
|
| 451 | + if (!empty($this->partitionBy)) { |
|
| 452 | 452 | $partition .= "\nPARTITION BY " . $this->partitionBy; |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | - if (! empty($this->partitionsNum)) { |
|
| 455 | + if (!empty($this->partitionsNum)) { |
|
| 456 | 456 | $partition .= "\nPARTITIONS " . $this->partitionsNum; |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | - if (! empty($this->subpartitionBy)) { |
|
| 459 | + if (!empty($this->subpartitionBy)) { |
|
| 460 | 460 | $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy; |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | - if (! empty($this->subpartitionsNum)) { |
|
| 463 | + if (!empty($this->subpartitionsNum)) { |
|
| 464 | 464 | $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum; |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | - if (! empty($this->partitions)) { |
|
| 467 | + if (!empty($this->partitions)) { |
|
| 468 | 468 | $partition .= "\n" . PartitionDefinition::build($this->partitions); |
| 469 | 469 | } |
| 470 | 470 | |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | . OptionsArray::build($this->options) . ' ' |
| 489 | 489 | . Expression::build($this->name) . ' ' |
| 490 | 490 | . $fields . ' AS ' . $builtStatement |
| 491 | - . (! empty($this->body) ? TokensList::build($this->body) : '') . ' ' |
|
| 491 | + . (!empty($this->body) ? TokensList::build($this->body) : '') . ' ' |
|
| 492 | 492 | . OptionsArray::build($this->entityOptions); |
| 493 | 493 | } |
| 494 | 494 | |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | $token = $list->getNextOfType(Token::TYPE_NUMBER); |
| 659 | 659 | --$list->idx; // `getNextOfType` also advances one position. |
| 660 | 660 | $this->subpartitionsNum = $token->value; |
| 661 | - } elseif (! empty($field)) { |
|
| 661 | + } elseif (!empty($field)) { |
|
| 662 | 662 | /* |
| 663 | 663 | * Handling the content of `PARTITION BY` and `SUBPARTITION BY`. |
| 664 | 664 | */ |
@@ -687,7 +687,7 @@ discard block |
||
| 687 | 687 | $field = null; |
| 688 | 688 | } |
| 689 | 689 | } elseif (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { |
| 690 | - if (! empty($this->partitionBy)) { |
|
| 690 | + if (!empty($this->partitionBy)) { |
|
| 691 | 691 | $this->partitions = ArrayObj::parse( |
| 692 | 692 | $parser, |
| 693 | 693 | $list, |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * |
| 158 | 158 | * @throws ParserException |
| 159 | 159 | */ |
| 160 | - public static function parse(Parser $parser, TokensList $list, array $options = []): Expression|null |
|
| 160 | + public static function parse(Parser $parser, TokensList $list, array $options = []): Expression | null |
|
| 161 | 161 | { |
| 162 | 162 | $ret = new static(); |
| 163 | 163 | |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | ]; |
| 201 | 201 | |
| 202 | 202 | // When a field is parsed, no parentheses are expected. |
| 203 | - if (! empty($options['parseField'])) { |
|
| 203 | + if (!empty($options['parseField'])) { |
|
| 204 | 204 | $options['breakOnParentheses'] = true; |
| 205 | 205 | $options['field'] = $options['parseField']; |
| 206 | 206 | } |
@@ -227,14 +227,14 @@ discard block |
||
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | if ($token->type === Token::TYPE_KEYWORD) { |
| 230 | - if (($brackets > 0) && empty($ret->subquery) && ! empty(Parser::$statementParsers[$token->keyword])) { |
|
| 230 | + if (($brackets > 0) && empty($ret->subquery) && !empty(Parser::$statementParsers[$token->keyword])) { |
|
| 231 | 231 | // A `(` was previously found and this keyword is the |
| 232 | 232 | // beginning of a statement, so this is a subquery. |
| 233 | 233 | $ret->subquery = $token->keyword; |
| 234 | 234 | } elseif ( |
| 235 | 235 | ($token->flags & Token::FLAG_KEYWORD_FUNCTION) |
| 236 | 236 | && (empty($options['parseField']) |
| 237 | - && ! $alias) |
|
| 237 | + && !$alias) |
|
| 238 | 238 | ) { |
| 239 | 239 | $isExpr = true; |
| 240 | 240 | } elseif (($token->flags & Token::FLAG_KEYWORD_RESERVED) && ($brackets === 0)) { |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | if ($token->keyword === 'AS') { |
| 249 | - if (! empty($options['breakOnAlias'])) { |
|
| 249 | + if (!empty($options['breakOnAlias'])) { |
|
| 250 | 250 | break; |
| 251 | 251 | } |
| 252 | 252 | |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | $isExpr = true; |
| 272 | - } elseif ($brackets === 0 && strlen((string) $ret->expr) > 0 && ! $alias) { |
|
| 272 | + } elseif ($brackets === 0 && strlen((string) $ret->expr) > 0 && !$alias) { |
|
| 273 | 273 | /* End of expression */ |
| 274 | 274 | break; |
| 275 | 275 | } |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | || (($token->type === Token::TYPE_OPERATOR) |
| 286 | 286 | && ($token->value !== '.')) |
| 287 | 287 | ) { |
| 288 | - if (! empty($options['parseField'])) { |
|
| 288 | + if (!empty($options['parseField'])) { |
|
| 289 | 289 | break; |
| 290 | 290 | } |
| 291 | 291 | |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | if ($token->type === Token::TYPE_OPERATOR) { |
| 298 | - if (! empty($options['breakOnParentheses']) && (($token->value === '(') || ($token->value === ')'))) { |
|
| 298 | + if (!empty($options['breakOnParentheses']) && (($token->value === '(') || ($token->value === ')'))) { |
|
| 299 | 299 | // No brackets were expected. |
| 300 | 300 | break; |
| 301 | 301 | } |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | |
| 320 | 320 | --$brackets; |
| 321 | 321 | if ($brackets === 0) { |
| 322 | - if (! empty($options['parenthesesDelimited'])) { |
|
| 322 | + if (!empty($options['parenthesesDelimited'])) { |
|
| 323 | 323 | // The current token is the last bracket, the next |
| 324 | 324 | // one will be outside the expression. |
| 325 | 325 | $ret->expr .= $token->token; |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | |
| 346 | 346 | if ($alias) { |
| 347 | 347 | // An alias is expected (the keyword `AS` was previously found). |
| 348 | - if (! empty($ret->alias)) { |
|
| 348 | + if (!empty($ret->alias)) { |
|
| 349 | 349 | $parser->error('An alias was previously found.', $token); |
| 350 | 350 | break; |
| 351 | 351 | } |
@@ -359,14 +359,14 @@ discard block |
||
| 359 | 359 | && ($prev[0] === null |
| 360 | 360 | || (($prev[0]->type !== Token::TYPE_OPERATOR || $prev[0]->token === ')') |
| 361 | 361 | && ($prev[0]->type !== Token::TYPE_KEYWORD |
| 362 | - || ! ($prev[0]->flags & Token::FLAG_KEYWORD_RESERVED)))) |
|
| 362 | + || !($prev[0]->flags & Token::FLAG_KEYWORD_RESERVED)))) |
|
| 363 | 363 | && (($prev[1]->type === Token::TYPE_STRING) |
| 364 | 364 | || ($prev[1]->type === Token::TYPE_SYMBOL |
| 365 | - && ! ($prev[1]->flags & Token::FLAG_SYMBOL_VARIABLE)) |
|
| 365 | + && !($prev[1]->flags & Token::FLAG_SYMBOL_VARIABLE)) |
|
| 366 | 366 | || ($prev[1]->type === Token::TYPE_NONE |
| 367 | 367 | && $prev[1]->token !== 'OVER')) |
| 368 | 368 | ) { |
| 369 | - if (! empty($ret->alias)) { |
|
| 369 | + if (!empty($ret->alias)) { |
|
| 370 | 370 | $parser->error('An alias was previously found.', $token); |
| 371 | 371 | break; |
| 372 | 372 | } |
@@ -392,12 +392,12 @@ discard block |
||
| 392 | 392 | |
| 393 | 393 | $ret->expr .= $token->token; |
| 394 | 394 | } |
| 395 | - } elseif (! $isExpr) { |
|
| 395 | + } elseif (!$isExpr) { |
|
| 396 | 396 | if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '.')) { |
| 397 | 397 | // Found a `.` which means we expect a column name and |
| 398 | 398 | // the column name we parsed is actually the table name |
| 399 | 399 | // and the table name is actually a database name. |
| 400 | - if (! empty($ret->database) || $dot) { |
|
| 400 | + if (!empty($ret->database) || $dot) { |
|
| 401 | 401 | $parser->error('Unexpected dot.', $token); |
| 402 | 402 | } |
| 403 | 403 | |
@@ -414,11 +414,11 @@ discard block |
||
| 414 | 414 | $dot = false; |
| 415 | 415 | } else { |
| 416 | 416 | // No alias is expected. |
| 417 | - if (! empty($options['breakOnAlias'])) { |
|
| 417 | + if (!empty($options['breakOnAlias'])) { |
|
| 418 | 418 | break; |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | - if (! empty($ret->alias)) { |
|
| 421 | + if (!empty($ret->alias)) { |
|
| 422 | 422 | $parser->error('An alias was previously found.', $token); |
| 423 | 423 | break; |
| 424 | 424 | } |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | $ret = implode('.', Context::escapeAll($fields)); |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | - if (! empty($component->alias)) { |
|
| 476 | + if (!empty($component->alias)) { |
|
| 477 | 477 | $ret .= ' AS ' . Context::escape($component->alias); |
| 478 | 478 | } |
| 479 | 479 | |