@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | * |
270 | 270 | * Used by all `CREATE` statements. |
271 | 271 | */ |
272 | - public Expression|null $name = null; |
|
272 | + public Expression | null $name = null; |
|
273 | 273 | |
274 | 274 | /** |
275 | 275 | * The options of the entity (table, procedure, function, etc.). |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | public function build(): string |
399 | 399 | { |
400 | 400 | $fields = ''; |
401 | - if (! empty($this->fields)) { |
|
401 | + if (!empty($this->fields)) { |
|
402 | 402 | if (is_array($this->fields)) { |
403 | 403 | $fields = CreateDefinition::buildAll($this->fields) . ' '; |
404 | 404 | } elseif ($this->fields instanceof ArrayObj) { |
@@ -437,23 +437,23 @@ discard block |
||
437 | 437 | |
438 | 438 | $partition = ''; |
439 | 439 | |
440 | - if (! empty($this->partitionBy)) { |
|
440 | + if (!empty($this->partitionBy)) { |
|
441 | 441 | $partition .= "\nPARTITION BY " . $this->partitionBy; |
442 | 442 | } |
443 | 443 | |
444 | - if (! empty($this->partitionsNum)) { |
|
444 | + if (!empty($this->partitionsNum)) { |
|
445 | 445 | $partition .= "\nPARTITIONS " . $this->partitionsNum; |
446 | 446 | } |
447 | 447 | |
448 | - if (! empty($this->subpartitionBy)) { |
|
448 | + if (!empty($this->subpartitionBy)) { |
|
449 | 449 | $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy; |
450 | 450 | } |
451 | 451 | |
452 | - if (! empty($this->subpartitionsNum)) { |
|
452 | + if (!empty($this->subpartitionsNum)) { |
|
453 | 453 | $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum; |
454 | 454 | } |
455 | 455 | |
456 | - if (! empty($this->partitions)) { |
|
456 | + if (!empty($this->partitions)) { |
|
457 | 457 | $partition .= "\n" . PartitionDefinition::buildAll($this->partitions); |
458 | 458 | } |
459 | 459 | |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | $token = $list->getNextOfType(TokenType::Number); |
648 | 648 | --$list->idx; // `getNextOfType` also advances one position. |
649 | 649 | $this->subpartitionsNum = $token->value; |
650 | - } elseif (! empty($field)) { |
|
650 | + } elseif (!empty($field)) { |
|
651 | 651 | /* |
652 | 652 | * Handling the content of `PARTITION BY` and `SUBPARTITION BY`. |
653 | 653 | */ |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | $field = null; |
677 | 677 | } |
678 | 678 | } elseif (($token->type === TokenType::Operator) && ($token->value === '(')) { |
679 | - if (! empty($this->partitionBy)) { |
|
679 | + if (!empty($this->partitionBy)) { |
|
680 | 680 | $this->partitions = ArrayObj::parse( |
681 | 681 | $parser, |
682 | 682 | $list, |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $this->str = $str; |
80 | 80 | $this->byteLen = mb_strlen($str, '8bit'); |
81 | - if (! mb_check_encoding($str, 'UTF-8')) { |
|
81 | + if (!mb_check_encoding($str, 'UTF-8')) { |
|
82 | 82 | $this->charLen = 0; |
83 | 83 | } else { |
84 | 84 | $this->charLen = mb_strlen($str, 'UTF-8'); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * |
101 | 101 | * @param int $offset the offset to be returned |
102 | 102 | */ |
103 | - public function offsetGet(mixed $offset): string|null |
|
103 | + public function offsetGet(mixed $offset): string | null |
|
104 | 104 | { |
105 | 105 | // This function moves the internal byte and character pointer to the requested offset. |
106 | 106 | // This function is part of hot code so the aim is to do the following |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | // The options of a clause should stay on the same line and everything that follows. |
436 | 436 | if ( |
437 | 437 | $this->options['parts_newline'] |
438 | - && ! $formattedOptions |
|
438 | + && !$formattedOptions |
|
439 | 439 | && empty(self::$inlineClauses[$lastClause]) |
440 | 440 | && ( |
441 | 441 | $curr->type !== TokenType::Keyword |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | end($blocksLineEndings) === true |
493 | 493 | || ( |
494 | 494 | empty(self::$inlineClauses[$lastClause]) |
495 | - && ! $shortGroup |
|
495 | + && !$shortGroup |
|
496 | 496 | && $this->options['parts_newline'] |
497 | 497 | ) |
498 | 498 | ) { |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | $lineEnded = false; |
529 | 529 | } elseif ( |
530 | 530 | $prev->keyword === 'DELIMITER' |
531 | - || ! ( |
|
531 | + || !( |
|
532 | 532 | ($prev->type === TokenType::Operator && ($prev->value === '.' || $prev->value === '(')) |
533 | 533 | // No space after . ( |
534 | 534 | || ($curr->type === TokenType::Operator |
@@ -643,13 +643,13 @@ discard block |
||
643 | 643 | |
644 | 644 | foreach ($this->options['formats'] as $format) { |
645 | 645 | if ( |
646 | - $token->type->value !== $format['type'] || ! (($token->flags & $format['flags']) === $format['flags']) |
|
646 | + $token->type->value !== $format['type'] || !(($token->flags & $format['flags']) === $format['flags']) |
|
647 | 647 | ) { |
648 | 648 | continue; |
649 | 649 | } |
650 | 650 | |
651 | 651 | // Running transformation function. |
652 | - if (! empty($format['function'])) { |
|
652 | + if (!empty($format['function'])) { |
|
653 | 653 | $func = $format['function']; |
654 | 654 | $text = $func($text); |
655 | 655 | } |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | * |
759 | 759 | * @psalm-return 1|2|false |
760 | 760 | */ |
761 | - public static function isClause(Token $token): int|false |
|
761 | + public static function isClause(Token $token): int | false |
|
762 | 762 | { |
763 | 763 | if ( |
764 | 764 | ($token->type === TokenType::Keyword && isset(Parser::STATEMENT_PARSERS[$token->keyword])) |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public static function getForeignKeys(CreateStatement $statement): array |
32 | 32 | { |
33 | - if (empty($statement->fields) || (! is_array($statement->fields)) || (! $statement->options->has('TABLE'))) { |
|
33 | + if (empty($statement->fields) || (!is_array($statement->fields)) || (!$statement->options->has('TABLE'))) { |
|
34 | 34 | return []; |
35 | 35 | } |
36 | 36 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | $columns = []; |
45 | 45 | foreach ($field->key->columns as $column) { |
46 | - if (! isset($column['name'])) { |
|
46 | + if (!isset($column['name'])) { |
|
47 | 47 | continue; |
48 | 48 | } |
49 | 49 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | 'index_list' => $columns, |
56 | 56 | ]; |
57 | 57 | |
58 | - if (! empty($field->references)) { |
|
58 | + if (!empty($field->references)) { |
|
59 | 59 | $tmp['ref_db_name'] = $field->references->table->database; |
60 | 60 | $tmp['ref_table_name'] = $field->references->table->table; |
61 | 61 | $tmp['ref_index_list'] = $field->references->columns; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public static function getFields(CreateStatement $statement): array |
98 | 98 | { |
99 | - if (empty($statement->fields) || (! is_array($statement->fields)) || (! $statement->options->has('TABLE'))) { |
|
99 | + if (empty($statement->fields) || (!is_array($statement->fields)) || (!$statement->options->has('TABLE'))) { |
|
100 | 100 | return []; |
101 | 101 | } |
102 | 102 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | 'timestamp_not_null' => false, |
114 | 114 | ]; |
115 | 115 | |
116 | - if (! $field->options) { |
|
116 | + if (!$field->options) { |
|
117 | 117 | continue; |
118 | 118 | } |
119 | 119 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | $option = $field->options->has('AS'); |
142 | 142 | |
143 | - if (! $option) { |
|
143 | + if (!$option) { |
|
144 | 144 | continue; |
145 | 145 | } |
146 | 146 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @param int|string $rowCount the row count |
34 | 34 | * @param int|string $offset the offset |
35 | 35 | */ |
36 | - public function __construct(int|string $rowCount = 0, int|string $offset = 0) |
|
36 | + public function __construct(int | string $rowCount = 0, int | string $offset = 0) |
|
37 | 37 | { |
38 | 38 | $this->rowCount = $rowCount; |
39 | 39 | $this->offset = $offset; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | // Skip if not a number or a bind parameter (?) |
89 | 89 | if ( |
90 | - ! ($token->type === TokenType::Number |
|
90 | + !($token->type === TokenType::Number |
|
91 | 91 | || ($token->type === TokenType::Symbol && ($token->flags & Token::FLAG_SYMBOL_PARAMETER))) |
92 | 92 | ) { |
93 | 93 | break; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * @param string|null $name the name of the function to be called |
35 | 35 | * @param string[]|ArrayObj|null $parameters the parameters of this function |
36 | 36 | */ |
37 | - public function __construct(string|null $name = null, array|ArrayObj|null $parameters = null) |
|
37 | + public function __construct(string | null $name = null, array | ArrayObj | null $parameters = null) |
|
38 | 38 | { |
39 | 39 | $this->name = $name; |
40 | 40 | if (is_array($parameters)) { |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | if ($token->type === TokenType::Operator && $token->value === '(') { |
88 | 88 | --$list->idx; // ArrayObj needs to start with `(` |
89 | 89 | $state = 1; |
90 | - continue;// do not add this token to the name |
|
90 | + continue; // do not add this token to the name |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | $ret->name .= $token->value; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * @param Expression $old old expression |
35 | 35 | * @param Expression $new new expression containing new name |
36 | 36 | */ |
37 | - public function __construct(Expression|null $old = null, Expression|null $new = null) |
|
37 | + public function __construct(Expression | null $old = null, Expression | null $new = null) |
|
38 | 38 | { |
39 | 39 | $this->old = $old; |
40 | 40 | $this->new = $new; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | // Last iteration was not saved. |
141 | - if (! empty($expr->old)) { |
|
141 | + if (!empty($expr->old)) { |
|
142 | 142 | $ret[] = $expr; |
143 | 143 | } |
144 | 144 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param string $inOut parameter's directional type (IN / OUT or None) |
45 | 45 | * @param DataType $type parameter's type |
46 | 46 | */ |
47 | - public function __construct(string|null $name = null, string|null $inOut = null, DataType|null $type = null) |
|
47 | + public function __construct(string | null $name = null, string | null $inOut = null, DataType | null $type = null) |
|
48 | 48 | { |
49 | 49 | $this->name = $name; |
50 | 50 | $this->inOut = $inOut; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | public function build(): string |
143 | 143 | { |
144 | 144 | $tmp = ''; |
145 | - if (! empty($this->inOut)) { |
|
145 | + if (!empty($this->inOut)) { |
|
146 | 146 | $tmp .= $this->inOut . ' '; |
147 | 147 | } |
148 | 148 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | * @param string[] $columns the columns referenced |
63 | 63 | * @param OptionsArray $options the options |
64 | 64 | */ |
65 | - public function __construct(Expression|null $table = null, array $columns = [], OptionsArray|null $options = null) |
|
65 | + public function __construct(Expression | null $table = null, array $columns = [], OptionsArray | null $options = null) |
|
66 | 66 | { |
67 | 67 | $this->table = $table; |
68 | 68 | $this->columns = $columns; |