@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | * @param Reference|null $references references |
151 | 151 | */ |
152 | 152 | public function __construct( |
153 | - string|null $name = null, |
|
154 | - OptionsArray|null $options = null, |
|
155 | - DataType|Key|null $type = null, |
|
153 | + string | null $name = null, |
|
154 | + OptionsArray | null $options = null, |
|
155 | + DataType | Key | null $type = null, |
|
156 | 156 | bool $isConstraint = false, |
157 | - Reference|null $references = null, |
|
157 | + Reference | null $references = null, |
|
158 | 158 | ) { |
159 | 159 | $this->name = $name; |
160 | 160 | $this->options = $options; |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $state = 4; |
237 | 237 | } elseif ($token->type === TokenType::Symbol || $token->type === TokenType::None) { |
238 | 238 | $expr->name = $token->value; |
239 | - if (! $expr->isConstraint) { |
|
239 | + if (!$expr->isConstraint) { |
|
240 | 240 | $state = 2; |
241 | 241 | } |
242 | 242 | } elseif ($token->type === TokenType::Keyword) { |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | |
278 | 278 | $state = 5; |
279 | 279 | } elseif ($state === 5) { |
280 | - if (! empty($expr->type) || ! empty($expr->key)) { |
|
280 | + if (!empty($expr->type) || !empty($expr->key)) { |
|
281 | 281 | $ret[] = $expr; |
282 | 282 | } |
283 | 283 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | } |
298 | 298 | |
299 | 299 | // Last iteration was not saved. |
300 | - if (! empty($expr->type) || ! empty($expr->key)) { |
|
300 | + if (!empty($expr->type) || !empty($expr->key)) { |
|
301 | 301 | $ret[] = $expr; |
302 | 302 | } |
303 | 303 | |
@@ -322,16 +322,16 @@ discard block |
||
322 | 322 | $tmp .= Context::escape($this->name) . ' '; |
323 | 323 | } |
324 | 324 | |
325 | - if (! empty($this->type)) { |
|
325 | + if (!empty($this->type)) { |
|
326 | 326 | $this->type->lowercase = true; |
327 | 327 | $tmp .= $this->type->build() . ' '; |
328 | 328 | } |
329 | 329 | |
330 | - if (! empty($this->key)) { |
|
330 | + if (!empty($this->key)) { |
|
331 | 331 | $tmp .= $this->key . ' '; |
332 | 332 | } |
333 | 333 | |
334 | - if (! empty($this->references)) { |
|
334 | + if (!empty($this->references)) { |
|
335 | 335 | $tmp .= 'REFERENCES ' . $this->references . ' '; |
336 | 336 | } |
337 | 337 |
@@ -264,9 +264,9 @@ discard block |
||
264 | 264 | * @param Token[] $unknown unparsed tokens found at the end of operation |
265 | 265 | */ |
266 | 266 | public function __construct( |
267 | - OptionsArray|null $options = null, |
|
268 | - Expression|string|null $field = null, |
|
269 | - array|null $partitions = null, |
|
267 | + OptionsArray | null $options = null, |
|
268 | + Expression | string | null $field = null, |
|
269 | + array | null $partitions = null, |
|
270 | 270 | public array $unknown = [], |
271 | 271 | ) { |
272 | 272 | $this->partitions = $partitions; |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | } elseif (($token->value === ',') && ($brackets === 0)) { |
402 | 402 | break; |
403 | 403 | } |
404 | - } elseif (! self::checkIfTokenQuotedSymbol($token) && $token->type !== TokenType::String) { |
|
404 | + } elseif (!self::checkIfTokenQuotedSymbol($token) && $token->type !== TokenType::String) { |
|
405 | 405 | if (isset(Parser::STATEMENT_PARSERS[$arrayKey]) && Parser::STATEMENT_PARSERS[$arrayKey] !== '') { |
406 | 406 | $list->idx++; // Ignore the current token |
407 | 407 | $nextToken = $list->getNext(); |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | } elseif ( |
425 | 425 | (array_key_exists($arrayKey, self::DATABASE_OPTIONS) |
426 | 426 | || array_key_exists($arrayKey, self::TABLE_OPTIONS)) |
427 | - && ! self::checkIfColumnDefinitionKeyword($arrayKey) |
|
427 | + && !self::checkIfColumnDefinitionKeyword($arrayKey) |
|
428 | 428 | ) { |
429 | 429 | // This alter operation has finished, which means a comma |
430 | 430 | // was missing before start of new alter operation |
@@ -347,13 +347,13 @@ discard block |
||
347 | 347 | * |
348 | 348 | * @param bool $isReserved checks if the keyword is reserved |
349 | 349 | */ |
350 | - public static function isKeyword(string $string, bool $isReserved = false): int|null |
|
350 | + public static function isKeyword(string $string, bool $isReserved = false): int | null |
|
351 | 351 | { |
352 | 352 | $upperString = strtoupper($string); |
353 | 353 | |
354 | 354 | if ( |
355 | - ! isset(static::$keywords[$upperString]) |
|
356 | - || ($isReserved && ! (static::$keywords[$upperString] & Token::FLAG_KEYWORD_RESERVED)) |
|
355 | + !isset(static::$keywords[$upperString]) |
|
356 | + || ($isReserved && !(static::$keywords[$upperString] & Token::FLAG_KEYWORD_RESERVED)) |
|
357 | 357 | ) { |
358 | 358 | return null; |
359 | 359 | } |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | /** |
365 | 365 | * Checks if the given string is an operator and returns the appropriate flag for the operator. |
366 | 366 | */ |
367 | - public static function isOperator(string $string): int|null |
|
367 | + public static function isOperator(string $string): int | null |
|
368 | 368 | { |
369 | 369 | return static::$operators[$string] ?? null; |
370 | 370 | } |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | * |
383 | 383 | * @return int|null the appropriate flag for the comment type |
384 | 384 | */ |
385 | - public static function isComment(string $string, bool $end = false): int|null |
|
385 | + public static function isComment(string $string, bool $end = false): int | null |
|
386 | 386 | { |
387 | 387 | if ($string === '') { |
388 | 388 | return null; |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | * |
446 | 446 | * @return int|null the appropriate flag for the symbol type |
447 | 447 | */ |
448 | - public static function isSymbol(string $string): int|null |
|
448 | + public static function isSymbol(string $string): int | null |
|
449 | 449 | { |
450 | 450 | if ($string === '') { |
451 | 451 | return null; |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | * |
474 | 474 | * @return int|null the appropriate flag for the string type |
475 | 475 | */ |
476 | - public static function isString(string $string): int|null |
|
476 | + public static function isString(string $string): int | null |
|
477 | 477 | { |
478 | 478 | if ($string === '') { |
479 | 479 | return null; |
@@ -522,8 +522,8 @@ discard block |
||
522 | 522 | $context = ContextMySql50700::class; |
523 | 523 | } |
524 | 524 | |
525 | - if (! class_exists($context)) { |
|
526 | - if (! class_exists(self::$contextPrefix . $context)) { |
|
525 | + if (!class_exists($context)) { |
|
526 | + if (!class_exists(self::$contextPrefix . $context)) { |
|
527 | 527 | return false; |
528 | 528 | } |
529 | 529 | |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | * |
550 | 550 | * @return string|null The loaded context. `null` if no context was loaded. |
551 | 551 | */ |
552 | - public static function loadClosest(string $context = ''): string|null |
|
552 | + public static function loadClosest(string $context = ''): string | null |
|
553 | 553 | { |
554 | 554 | $length = strlen($context); |
555 | 555 | for ($i = $length; $i > 0;) { |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | $i -= 2; |
564 | 564 | $part = substr($context, $i, 2); |
565 | 565 | /* No more numeric parts to strip */ |
566 | - if (! is_numeric($part)) { |
|
566 | + if (!is_numeric($part)) { |
|
567 | 567 | break 2; |
568 | 568 | } |
569 | 569 | } while (intval($part) === 0 && $i > 0); |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | /** |
595 | 595 | * Sets the SQL mode. |
596 | 596 | */ |
597 | - public static function setMode(int|string $mode = self::SQL_MODE_NONE): void |
|
597 | + public static function setMode(int | string $mode = self::SQL_MODE_NONE): void |
|
598 | 598 | { |
599 | 599 | if (is_int($mode)) { |
600 | 600 | static::$mode = $mode; |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | public static function escape(string $str, string $quote = '`'): string |
661 | 661 | { |
662 | 662 | if ( |
663 | - (static::$mode & self::SQL_MODE_NO_ENCLOSING_QUOTES) && ! ( |
|
663 | + (static::$mode & self::SQL_MODE_NO_ENCLOSING_QUOTES) && !( |
|
664 | 664 | static::isKeyword($str, true) || self::doesIdentifierRequireQuoting($str) |
665 | 665 | ) |
666 | 666 | ) { |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | * |
698 | 698 | * @return bool false on empty param, true/false on given constant/int value |
699 | 699 | */ |
700 | - public static function hasMode(int|null $flag = null): bool |
|
700 | + public static function hasMode(int | null $flag = null): bool |
|
701 | 701 | { |
702 | 702 | if (empty($flag)) { |
703 | 703 | return false; |