@@ -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::buildAll($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::buildAll($this->partitions); |
| 469 | 469 | } |
| 470 | 470 | |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | . $this->options->build() . ' ' |
| 489 | 489 | . $this->name->build() . ' ' |
| 490 | 490 | . $fields . ' AS ' . $builtStatement |
| 491 | - . (! empty($this->body) ? TokensList::build($this->body) : '') . ' ' |
|
| 491 | + . (!empty($this->body) ? TokensList::build($this->body) : '') . ' ' |
|
| 492 | 492 | . ($this->entityOptions?->build() ?? ''); |
| 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, |
@@ -358,13 +358,13 @@ discard block |
||
| 358 | 358 | * |
| 359 | 359 | * @param bool $isReserved checks if the keyword is reserved |
| 360 | 360 | */ |
| 361 | - public static function isKeyword(string $string, bool $isReserved = false): int|null |
|
| 361 | + public static function isKeyword(string $string, bool $isReserved = false): int | null |
|
| 362 | 362 | { |
| 363 | 363 | $upperString = strtoupper($string); |
| 364 | 364 | |
| 365 | 365 | if ( |
| 366 | - ! isset(static::$keywords[$upperString]) |
|
| 367 | - || ($isReserved && ! (static::$keywords[$upperString] & Token::FLAG_KEYWORD_RESERVED)) |
|
| 366 | + !isset(static::$keywords[$upperString]) |
|
| 367 | + || ($isReserved && !(static::$keywords[$upperString] & Token::FLAG_KEYWORD_RESERVED)) |
|
| 368 | 368 | ) { |
| 369 | 369 | return null; |
| 370 | 370 | } |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | /** |
| 376 | 376 | * Checks if the given string is an operator and returns the appropriate flag for the operator. |
| 377 | 377 | */ |
| 378 | - public static function isOperator(string $string): int|null |
|
| 378 | + public static function isOperator(string $string): int | null |
|
| 379 | 379 | { |
| 380 | 380 | return static::$operators[$string] ?? null; |
| 381 | 381 | } |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | * |
| 394 | 394 | * @return int|null the appropriate flag for the comment type |
| 395 | 395 | */ |
| 396 | - public static function isComment(string $string, bool $end = false): int|null |
|
| 396 | + public static function isComment(string $string, bool $end = false): int | null |
|
| 397 | 397 | { |
| 398 | 398 | if ($string === '') { |
| 399 | 399 | return null; |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | * |
| 457 | 457 | * @return int|null the appropriate flag for the symbol type |
| 458 | 458 | */ |
| 459 | - public static function isSymbol(string $string): int|null |
|
| 459 | + public static function isSymbol(string $string): int | null |
|
| 460 | 460 | { |
| 461 | 461 | if ($string === '') { |
| 462 | 462 | return null; |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | * |
| 485 | 485 | * @return int|null the appropriate flag for the string type |
| 486 | 486 | */ |
| 487 | - public static function isString(string $string): int|null |
|
| 487 | + public static function isString(string $string): int | null |
|
| 488 | 488 | { |
| 489 | 489 | if ($string === '') { |
| 490 | 490 | return null; |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | $context = self::$contextPrefix . $context; |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | - if (! class_exists($context)) { |
|
| 541 | + if (!class_exists($context)) { |
|
| 542 | 542 | return false; |
| 543 | 543 | } |
| 544 | 544 | |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | * |
| 561 | 561 | * @return string|null The loaded context. `null` if no context was loaded. |
| 562 | 562 | */ |
| 563 | - public static function loadClosest(string $context = ''): string|null |
|
| 563 | + public static function loadClosest(string $context = ''): string | null |
|
| 564 | 564 | { |
| 565 | 565 | $length = strlen($context); |
| 566 | 566 | for ($i = $length; $i > 0;) { |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | $i -= 2; |
| 575 | 575 | $part = substr($context, $i, 2); |
| 576 | 576 | /* No more numeric parts to strip */ |
| 577 | - if (! is_numeric($part)) { |
|
| 577 | + if (!is_numeric($part)) { |
|
| 578 | 578 | break 2; |
| 579 | 579 | } |
| 580 | 580 | } while (intval($part) === 0 && $i > 0); |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | public static function escape(string $str, string $quote = '`'): string |
| 676 | 676 | { |
| 677 | 677 | if ( |
| 678 | - (static::$mode & self::SQL_MODE_NO_ENCLOSING_QUOTES) && ! ( |
|
| 678 | + (static::$mode & self::SQL_MODE_NO_ENCLOSING_QUOTES) && !( |
|
| 679 | 679 | static::isKeyword($str, true) || self::doesIdentifierRequireQuoting($str) |
| 680 | 680 | ) |
| 681 | 681 | ) { |
@@ -722,7 +722,7 @@ discard block |
||
| 722 | 722 | * |
| 723 | 723 | * @return bool false on empty param, true/false on given constant/int value |
| 724 | 724 | */ |
| 725 | - public static function hasMode(int|null $flag = null): bool |
|
| 725 | + public static function hasMode(int | null $flag = null): bool |
|
| 726 | 726 | { |
| 727 | 727 | if (empty($flag)) { |
| 728 | 728 | return false; |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | } elseif (($token->value === ',') && ($brackets === 0)) { |
| 423 | 423 | break; |
| 424 | 424 | } |
| 425 | - } elseif (! self::checkIfTokenQuotedSymbol($token)) { |
|
| 425 | + } elseif (!self::checkIfTokenQuotedSymbol($token)) { |
|
| 426 | 426 | // If the current token is "SET" or "ENUM", we want to avoid the token between their parenthesis in |
| 427 | 427 | // the unknown tokens. |
| 428 | 428 | if (in_array($token->value, ['SET', 'ENUM'], true)) { |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | ); |
| 442 | 442 | break; |
| 443 | 443 | } |
| 444 | - } elseif (! empty(Parser::$statementParsers[$arrayKey])) { |
|
| 444 | + } elseif (!empty(Parser::$statementParsers[$arrayKey])) { |
|
| 445 | 445 | // We have reached the end of ALTER operation and suddenly found |
| 446 | 446 | // a start to new statement, but have not found a delimiter between them |
| 447 | 447 | $parser->error( |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | } elseif ( |
| 453 | 453 | (array_key_exists($arrayKey, self::$databaseOptions) |
| 454 | 454 | || array_key_exists($arrayKey, self::$tableOptions)) |
| 455 | - && ! self::checkIfColumnDefinitionKeyword($arrayKey) |
|
| 455 | + && !self::checkIfColumnDefinitionKeyword($arrayKey) |
|
| 456 | 456 | ) { |
| 457 | 457 | // This alter operation has finished, which means a comma |
| 458 | 458 | // was missing before start of new alter operation |