@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | * |
282 | 282 | * Used by all `CREATE` statements. |
283 | 283 | */ |
284 | - public Expression|null $name = null; |
|
284 | + public Expression | null $name = null; |
|
285 | 285 | |
286 | 286 | /** |
287 | 287 | * The options of the entity (table, procedure, function, etc.). |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | public function build(): string |
411 | 411 | { |
412 | 412 | $fields = ''; |
413 | - if (! empty($this->fields)) { |
|
413 | + if (!empty($this->fields)) { |
|
414 | 414 | if (is_array($this->fields)) { |
415 | 415 | $fields = CreateDefinition::buildAll($this->fields) . ' '; |
416 | 416 | } elseif ($this->fields instanceof ArrayObj) { |
@@ -449,23 +449,23 @@ discard block |
||
449 | 449 | |
450 | 450 | $partition = ''; |
451 | 451 | |
452 | - if (! empty($this->partitionBy)) { |
|
452 | + if (!empty($this->partitionBy)) { |
|
453 | 453 | $partition .= "\nPARTITION BY " . $this->partitionBy; |
454 | 454 | } |
455 | 455 | |
456 | - if (! empty($this->partitionsNum)) { |
|
456 | + if (!empty($this->partitionsNum)) { |
|
457 | 457 | $partition .= "\nPARTITIONS " . $this->partitionsNum; |
458 | 458 | } |
459 | 459 | |
460 | - if (! empty($this->subpartitionBy)) { |
|
460 | + if (!empty($this->subpartitionBy)) { |
|
461 | 461 | $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy; |
462 | 462 | } |
463 | 463 | |
464 | - if (! empty($this->subpartitionsNum)) { |
|
464 | + if (!empty($this->subpartitionsNum)) { |
|
465 | 465 | $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum; |
466 | 466 | } |
467 | 467 | |
468 | - if (! empty($this->partitions)) { |
|
468 | + if (!empty($this->partitions)) { |
|
469 | 469 | $partition .= "\n" . PartitionDefinition::buildAll($this->partitions); |
470 | 470 | } |
471 | 471 | |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | . OptionsArray::build($this->options) . ' ' |
490 | 490 | . Expression::build($this->name) . ' ' |
491 | 491 | . $fields . ' AS ' . $builtStatement |
492 | - . (! empty($this->body) ? TokensList::build($this->body) : '') . ' ' |
|
492 | + . (!empty($this->body) ? TokensList::build($this->body) : '') . ' ' |
|
493 | 493 | . OptionsArray::build($this->entityOptions); |
494 | 494 | } |
495 | 495 | |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | $token = $list->getNextOfType(TokenType::Number); |
660 | 660 | --$list->idx; // `getNextOfType` also advances one position. |
661 | 661 | $this->subpartitionsNum = $token->value; |
662 | - } elseif (! empty($field)) { |
|
662 | + } elseif (!empty($field)) { |
|
663 | 663 | /* |
664 | 664 | * Handling the content of `PARTITION BY` and `SUBPARTITION BY`. |
665 | 665 | */ |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | $field = null; |
689 | 689 | } |
690 | 690 | } elseif (($token->type === TokenType::Operator) && ($token->value === '(')) { |
691 | - if (! empty($this->partitionBy)) { |
|
691 | + if (!empty($this->partitionBy)) { |
|
692 | 692 | $this->partitions = ArrayObj::parse( |
693 | 693 | $parser, |
694 | 694 | $list, |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | break; |
131 | 131 | } |
132 | 132 | } elseif ($state === 2) { |
133 | - if (! ($token->type === TokenType::Keyword && $token->keyword === 'AS')) { |
|
133 | + if (!($token->type === TokenType::Keyword && $token->keyword === 'AS')) { |
|
134 | 134 | $parser->error('AS keyword was expected.', $token); |
135 | 135 | break; |
136 | 136 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $list->idx++; // Ignore the current token |
143 | 143 | $nextKeyword = $list->getNext(); |
144 | 144 | |
145 | - if (! ($token->value === '(' && ($nextKeyword && $nextKeyword->value === 'SELECT'))) { |
|
145 | + if (!($token->value === '(' && ($nextKeyword && $nextKeyword->value === 'SELECT'))) { |
|
146 | 146 | $parser->error('Subquery of the CTE was expected.', $token); |
147 | 147 | $list->idx = $idxBeforeGetNext; |
148 | 148 | break; |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | /** |
290 | 290 | * Get tokens within the WITH expression to use them in another parser |
291 | 291 | */ |
292 | - private function getSubTokenList(TokensList $list): ParserException|TokensList |
|
292 | + private function getSubTokenList(TokensList $list): ParserException | TokensList |
|
293 | 293 | { |
294 | 294 | $idx = $list->idx; |
295 | 295 | $token = $list->tokens[$list->idx]; |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | } |
306 | 306 | |
307 | 307 | ++$list->idx; |
308 | - if (! isset($list->tokens[$list->idx])) { |
|
308 | + if (!isset($list->tokens[$list->idx])) { |
|
309 | 309 | break; |
310 | 310 | } |
311 | 311 |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * Gets the next token. Skips any irrelevant token (whitespaces and |
95 | 95 | * comments). |
96 | 96 | */ |
97 | - public function getNext(): Token|null |
|
97 | + public function getNext(): Token | null |
|
98 | 98 | { |
99 | 99 | for (; $this->idx < $this->count; ++$this->idx) { |
100 | 100 | if ( |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * Gets the previous token. Skips any irrelevant token (whitespaces and |
113 | 113 | * comments). |
114 | 114 | */ |
115 | - public function getPrevious(): Token|null |
|
115 | + public function getPrevious(): Token | null |
|
116 | 116 | { |
117 | 117 | for (; $this->idx >= 0; --$this->idx) { |
118 | 118 | if ( |
@@ -131,9 +131,9 @@ discard block |
||
131 | 131 | * |
132 | 132 | * @param TokenType|TokenType[] $type the type |
133 | 133 | */ |
134 | - public function getPreviousOfType(TokenType|array $type): Token|null |
|
134 | + public function getPreviousOfType(TokenType | array $type): Token | null |
|
135 | 135 | { |
136 | - if (! is_array($type)) { |
|
136 | + if (!is_array($type)) { |
|
137 | 137 | $type = [$type]; |
138 | 138 | } |
139 | 139 | |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | * |
152 | 152 | * @param TokenType|TokenType[] $type the type |
153 | 153 | */ |
154 | - public function getNextOfType(TokenType|array $type): Token|null |
|
154 | + public function getNextOfType(TokenType | array $type): Token | null |
|
155 | 155 | { |
156 | - if (! is_array($type)) { |
|
156 | + if (!is_array($type)) { |
|
157 | 157 | $type = [$type]; |
158 | 158 | } |
159 | 159 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * @param TokenType $type the type of the token |
173 | 173 | * @param string $value the value of the token |
174 | 174 | */ |
175 | - public function getNextOfTypeAndValue(TokenType $type, $value): Token|null |
|
175 | + public function getNextOfTypeAndValue(TokenType $type, $value): Token | null |
|
176 | 176 | { |
177 | 177 | for (; $this->idx < $this->count; ++$this->idx) { |
178 | 178 | if (($this->tokens[$this->idx]->type === $type) && ($this->tokens[$this->idx]->value === $value)) { |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | * @param TokenType $type the type of the token |
190 | 190 | * @param int $flag the flag of the token |
191 | 191 | */ |
192 | - public function getNextOfTypeAndFlag(TokenType $type, int $flag): Token|null |
|
192 | + public function getNextOfTypeAndFlag(TokenType $type, int $flag): Token | null |
|
193 | 193 | { |
194 | 194 | for (; $this->idx < $this->count; ++$this->idx) { |
195 | 195 | if (($this->tokens[$this->idx]->type === $type) && ($this->tokens[$this->idx]->flags === $flag)) { |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | * |
221 | 221 | * @param int $offset the offset to be returned |
222 | 222 | */ |
223 | - public function offsetGet($offset): Token|null |
|
223 | + public function offsetGet($offset): Token | null |
|
224 | 224 | { |
225 | 225 | return $offset < $this->count ? $this->tokens[$offset] : null; |
226 | 226 | } |