@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | { |
189 | 189 | $this->str = $str; |
190 | 190 | $this->byteLen = mb_strlen($str, '8bit'); |
191 | - if (! mb_check_encoding($str, 'UTF-8')) { |
|
191 | + if (!mb_check_encoding($str, 'UTF-8')) { |
|
192 | 192 | $this->charLen = 0; |
193 | 193 | } else { |
194 | 194 | $this->charLen = mb_strlen($str, 'UTF-8'); |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | // Use the default ASCII map as queries are mostly ASCII chars |
299 | 299 | // ord($byte) has a performance cost |
300 | 300 | |
301 | - if (! isset(static::$asciiMap[$byte])) { |
|
301 | + if (!isset(static::$asciiMap[$byte])) { |
|
302 | 302 | // Complete the cache with missing items |
303 | 303 | static::$asciiMap[$byte] = ord($byte); |
304 | 304 | } |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | // The options of a clause should stay on the same line and everything that follows. |
437 | 437 | if ( |
438 | 438 | $this->options['parts_newline'] |
439 | - && ! $formattedOptions |
|
439 | + && !$formattedOptions |
|
440 | 440 | && empty(self::$inlineClauses[$lastClause]) |
441 | 441 | && ( |
442 | 442 | $curr->type !== Token::TYPE_KEYWORD |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | end($blocksLineEndings) === true |
497 | 497 | || ( |
498 | 498 | empty(self::$inlineClauses[$lastClause]) |
499 | - && ! $shortGroup |
|
499 | + && !$shortGroup |
|
500 | 500 | && $this->options['parts_newline'] |
501 | 501 | ) |
502 | 502 | ) { |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | if ( |
539 | 539 | // A space after delimiters that are longer than 2 characters. |
540 | 540 | $prev->keyword === 'DELIMITER' |
541 | - || ! ( |
|
541 | + || !( |
|
542 | 542 | ($prev->type === Token::TYPE_OPERATOR && ($prev->value === '.' || $prev->value === '(')) |
543 | 543 | // No space after . ( |
544 | 544 | || ($curr->type === Token::TYPE_OPERATOR |
@@ -652,12 +652,12 @@ discard block |
||
652 | 652 | static $prev; |
653 | 653 | |
654 | 654 | foreach ($this->options['formats'] as $format) { |
655 | - if ($token->type !== $format['type'] || ! (($token->flags & $format['flags']) === $format['flags'])) { |
|
655 | + if ($token->type !== $format['type'] || !(($token->flags & $format['flags']) === $format['flags'])) { |
|
656 | 656 | continue; |
657 | 657 | } |
658 | 658 | |
659 | 659 | // Running transformation function. |
660 | - if (! empty($format['function'])) { |
|
660 | + if (!empty($format['function'])) { |
|
661 | 661 | $func = $format['function']; |
662 | 662 | $text = $func($text); |
663 | 663 | } |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | * |
769 | 769 | * @psalm-return 1|2|false |
770 | 770 | */ |
771 | - public static function isClause($token): int|false |
|
771 | + public static function isClause($token): int | false |
|
772 | 772 | { |
773 | 773 | if ( |
774 | 774 | ($token->type === Token::TYPE_KEYWORD && isset(Parser::$statementParsers[$token->keyword])) |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | public function build(): string |
412 | 412 | { |
413 | 413 | $fields = ''; |
414 | - if (! empty($this->fields)) { |
|
414 | + if (!empty($this->fields)) { |
|
415 | 415 | if (is_array($this->fields)) { |
416 | 416 | $fields = CreateDefinition::build($this->fields) . ' '; |
417 | 417 | } elseif ($this->fields instanceof ArrayObj) { |
@@ -450,23 +450,23 @@ discard block |
||
450 | 450 | |
451 | 451 | $partition = ''; |
452 | 452 | |
453 | - if (! empty($this->partitionBy)) { |
|
453 | + if (!empty($this->partitionBy)) { |
|
454 | 454 | $partition .= "\nPARTITION BY " . $this->partitionBy; |
455 | 455 | } |
456 | 456 | |
457 | - if (! empty($this->partitionsNum)) { |
|
457 | + if (!empty($this->partitionsNum)) { |
|
458 | 458 | $partition .= "\nPARTITIONS " . $this->partitionsNum; |
459 | 459 | } |
460 | 460 | |
461 | - if (! empty($this->subpartitionBy)) { |
|
461 | + if (!empty($this->subpartitionBy)) { |
|
462 | 462 | $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy; |
463 | 463 | } |
464 | 464 | |
465 | - if (! empty($this->subpartitionsNum)) { |
|
465 | + if (!empty($this->subpartitionsNum)) { |
|
466 | 466 | $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum; |
467 | 467 | } |
468 | 468 | |
469 | - if (! empty($this->partitions)) { |
|
469 | + if (!empty($this->partitions)) { |
|
470 | 470 | $partition .= "\n" . PartitionDefinition::build($this->partitions); |
471 | 471 | } |
472 | 472 | |
@@ -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 | } elseif ($this->options->has('TRIGGER')) { |
494 | 494 | return 'CREATE ' |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | ] |
543 | 543 | ); |
544 | 544 | |
545 | - if (! isset($this->name) || ($this->name === '')) { |
|
545 | + if (!isset($this->name) || ($this->name === '')) { |
|
546 | 546 | $parser->error('The name of the entity was expected.', $list->tokens[$list->idx]); |
547 | 547 | } else { |
548 | 548 | ++$list->idx; // Skipping field. |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | $token = $list->getNextOfType(Token::TYPE_NUMBER); |
655 | 655 | --$list->idx; // `getNextOfType` also advances one position. |
656 | 656 | $this->subpartitionsNum = $token->value; |
657 | - } elseif (! empty($field)) { |
|
657 | + } elseif (!empty($field)) { |
|
658 | 658 | /* |
659 | 659 | * Handling the content of `PARTITION BY` and `SUBPARTITION BY`. |
660 | 660 | */ |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | $field = null; |
684 | 684 | } |
685 | 685 | } elseif (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { |
686 | - if (! empty($this->partitionBy)) { |
|
686 | + if (!empty($this->partitionBy)) { |
|
687 | 687 | $this->partitions = ArrayObj::parse( |
688 | 688 | $parser, |
689 | 689 | $list, |