@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | // The code below extracts only the relevant information. |
| 84 | 84 | |
| 85 | 85 | // Extracting lexer's errors. |
| 86 | - if (! empty($lexer->errors)) { |
|
| 86 | + if (!empty($lexer->errors)) { |
|
| 87 | 87 | /** @var LexerException $err */ |
| 88 | 88 | foreach ($lexer->errors as $err) { |
| 89 | 89 | $lexerErrors[] = [ |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | // Extracting parser's errors. |
| 101 | - if (! empty($parser->errors)) { |
|
| 101 | + if (!empty($parser->errors)) { |
|
| 102 | 102 | /** @var ParserException $err */ |
| 103 | 103 | foreach ($parser->errors as $err) { |
| 104 | 104 | $parserErrors[] = [ |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | public static function build($type, $input, $output, $debug = null, $ansi = false): void |
| 137 | 137 | { |
| 138 | 138 | // Support query types: `lexer` / `parser`. |
| 139 | - if (! in_array($type, ['lexer', 'parser'])) { |
|
| 139 | + if (!in_array($type, ['lexer', 'parser'])) { |
|
| 140 | 140 | throw new Exception('Unknown test type (expected `lexer` or `parser`).'); |
| 141 | 141 | } |
| 142 | 142 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | ); |
| 182 | 182 | |
| 183 | 183 | // Remove the project path from .out file, it changes for each dev |
| 184 | - $projectFolder = dirname(__DIR__, 2);// Jump to root |
|
| 184 | + $projectFolder = dirname(__DIR__, 2); // Jump to root |
|
| 185 | 185 | $encoded = str_replace($projectFolder, '<project-root>', $encoded); |
| 186 | 186 | |
| 187 | 187 | file_put_contents($output, $encoded); |
@@ -219,11 +219,11 @@ discard block |
||
| 219 | 219 | if (is_dir($inputFile)) { |
| 220 | 220 | // Creating required directories to maintain the structure. |
| 221 | 221 | // Ignoring errors if the folder structure exists already. |
| 222 | - if (! is_dir($outputFile)) { |
|
| 222 | + if (!is_dir($outputFile)) { |
|
| 223 | 223 | mkdir($outputFile); |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - if (($debug !== null) && (! is_dir($debugFile))) { |
|
| 226 | + if (($debug !== null) && (!is_dir($debugFile))) { |
|
| 227 | 227 | mkdir($debugFile); |
| 228 | 228 | } |
| 229 | 229 | |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | // Building the test. |
| 241 | - if (! file_exists($outputFile)) { |
|
| 241 | + if (!file_exists($outputFile)) { |
|
| 242 | 242 | echo sprintf("Building test for %s...\n", $inputFile); |
| 243 | 243 | static::build( |
| 244 | 244 | str_contains($inputFile, 'lex') ? 'lexer' : 'parser', |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $len = $str instanceof UtfString ? $str->length() : strlen($str); |
| 182 | 182 | |
| 183 | 183 | // For multi-byte strings, a new instance of `UtfString` is initialized. |
| 184 | - if (! $str instanceof UtfString && $len !== mb_strlen($str, 'UTF-8')) { |
|
| 184 | + if (!$str instanceof UtfString && $len !== mb_strlen($str, 'UTF-8')) { |
|
| 185 | 185 | $str = new UtfString($str); |
| 186 | 186 | } |
| 187 | 187 | |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $this->strict = $strict; |
| 192 | 192 | |
| 193 | 193 | // Setting the delimiter. |
| 194 | - $this->setDelimiter(! empty($delimiter) ? $delimiter : static::$defaultDelimiter); |
|
| 194 | + $this->setDelimiter(!empty($delimiter) ? $delimiter : static::$defaultDelimiter); |
|
| 195 | 195 | |
| 196 | 196 | $this->lex(); |
| 197 | 197 | } |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | $delimiterLen = 0; |
| 316 | 316 | while ( |
| 317 | 317 | ++$this->last < $this->len |
| 318 | - && ! Context::isWhitespace($this->str[$this->last]) |
|
| 318 | + && !Context::isWhitespace($this->str[$this->last]) |
|
| 319 | 319 | && $delimiterLen < 15 |
| 320 | 320 | ) { |
| 321 | 321 | $this->delimiter .= $this->str[$this->last]; |
@@ -374,8 +374,8 @@ discard block |
||
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | if ( |
| 377 | - ($next->type !== Token::TYPE_KEYWORD || ! in_array($next->value, ['FROM', 'USING'], true)) |
|
| 378 | - && ($next->type !== Token::TYPE_OPERATOR || ! in_array($next->value, [',', ')'], true)) |
|
| 377 | + ($next->type !== Token::TYPE_KEYWORD || !in_array($next->value, ['FROM', 'USING'], true)) |
|
| 378 | + && ($next->type !== Token::TYPE_OPERATOR || !in_array($next->value, [',', ')'], true)) |
|
| 379 | 379 | ) { |
| 380 | 380 | continue; |
| 381 | 381 | } |
@@ -413,10 +413,10 @@ discard block |
||
| 413 | 413 | $next = $this->list->getNext(); |
| 414 | 414 | if ( |
| 415 | 415 | ($next->type !== Token::TYPE_KEYWORD |
| 416 | - || ! in_array($next->value, $this->keywordNameIndicators, true) |
|
| 416 | + || !in_array($next->value, $this->keywordNameIndicators, true) |
|
| 417 | 417 | ) |
| 418 | 418 | && ($next->type !== Token::TYPE_OPERATOR |
| 419 | - || ! in_array($next->value, $this->operatorNameIndicators, true) |
|
| 419 | + || !in_array($next->value, $this->operatorNameIndicators, true) |
|
| 420 | 420 | ) |
| 421 | 421 | && ($next->value !== null) |
| 422 | 422 | ) { |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | /** |
| 456 | 456 | * Parses a keyword. |
| 457 | 457 | */ |
| 458 | - public function parseKeyword(): Token|null |
|
| 458 | + public function parseKeyword(): Token | null |
|
| 459 | 459 | { |
| 460 | 460 | $token = ''; |
| 461 | 461 | |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | $token .= $this->str[$this->last]; |
| 496 | 496 | $flags = Context::isKeyword($token); |
| 497 | 497 | |
| 498 | - if (($this->last + 1 !== $this->len && ! Context::isSeparator($this->str[$this->last + 1])) || ! $flags) { |
|
| 498 | + if (($this->last + 1 !== $this->len && !Context::isSeparator($this->str[$this->last + 1])) || !$flags) { |
|
| 499 | 499 | continue; |
| 500 | 500 | } |
| 501 | 501 | |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | /** |
| 516 | 516 | * Parses a label. |
| 517 | 517 | */ |
| 518 | - public function parseLabel(): Token|null |
|
| 518 | + public function parseLabel(): Token | null |
|
| 519 | 519 | { |
| 520 | 520 | $token = ''; |
| 521 | 521 | |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | /** |
| 560 | 560 | * Parses an operator. |
| 561 | 561 | */ |
| 562 | - public function parseOperator(): Token|null |
|
| 562 | + public function parseOperator(): Token | null |
|
| 563 | 563 | { |
| 564 | 564 | $token = ''; |
| 565 | 565 | |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | $token .= $this->str[$this->last]; |
| 580 | 580 | $flags = Context::isOperator($token); |
| 581 | 581 | |
| 582 | - if (! $flags) { |
|
| 582 | + if (!$flags) { |
|
| 583 | 583 | continue; |
| 584 | 584 | } |
| 585 | 585 | |
@@ -595,11 +595,11 @@ discard block |
||
| 595 | 595 | /** |
| 596 | 596 | * Parses a whitespace. |
| 597 | 597 | */ |
| 598 | - public function parseWhitespace(): Token|null |
|
| 598 | + public function parseWhitespace(): Token | null |
|
| 599 | 599 | { |
| 600 | 600 | $token = $this->str[$this->last]; |
| 601 | 601 | |
| 602 | - if (! Context::isWhitespace($token)) { |
|
| 602 | + if (!Context::isWhitespace($token)) { |
|
| 603 | 603 | return null; |
| 604 | 604 | } |
| 605 | 605 | |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | /** |
| 616 | 616 | * Parses a comment. |
| 617 | 617 | */ |
| 618 | - public function parseComment(): Token|null |
|
| 618 | + public function parseComment(): Token | null |
|
| 619 | 619 | { |
| 620 | 620 | $iBak = $this->last; |
| 621 | 621 | $token = $this->str[$this->last]; |
@@ -732,7 +732,7 @@ discard block |
||
| 732 | 732 | /** |
| 733 | 733 | * Parses a boolean. |
| 734 | 734 | */ |
| 735 | - public function parseBool(): Token|null |
|
| 735 | + public function parseBool(): Token | null |
|
| 736 | 736 | { |
| 737 | 737 | if ($this->last + 3 >= $this->len) { |
| 738 | 738 | // At least `min(strlen('TRUE'), strlen('FALSE'))` characters are |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | /** |
| 764 | 764 | * Parses a number. |
| 765 | 765 | */ |
| 766 | - public function parseNumber(): Token|null |
|
| 766 | + public function parseNumber(): Token | null |
|
| 767 | 767 | { |
| 768 | 768 | // A rudimentary state machine is being used to parse numbers due to |
| 769 | 769 | // the various forms of their notation. |
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | } elseif ($state === 2) { |
| 834 | 834 | $flags |= Token::FLAG_NUMBER_HEX; |
| 835 | 835 | if ( |
| 836 | - ! ( |
|
| 836 | + !( |
|
| 837 | 837 | ($this->str[$this->last] >= '0' && $this->str[$this->last] <= '9') |
| 838 | 838 | || ($this->str[$this->last] >= 'A' && $this->str[$this->last] <= 'F') |
| 839 | 839 | || ($this->str[$this->last] >= 'a' && $this->str[$this->last] <= 'f') |
@@ -929,12 +929,12 @@ discard block |
||
| 929 | 929 | * |
| 930 | 930 | * @throws LexerException |
| 931 | 931 | */ |
| 932 | - public function parseString($quote = ''): Token|null |
|
| 932 | + public function parseString($quote = ''): Token | null |
|
| 933 | 933 | { |
| 934 | 934 | $token = $this->str[$this->last]; |
| 935 | 935 | $flags = Context::isString($token); |
| 936 | 936 | |
| 937 | - if (! $flags && $token !== $quote) { |
|
| 937 | + if (!$flags && $token !== $quote) { |
|
| 938 | 938 | return null; |
| 939 | 939 | } |
| 940 | 940 | |
@@ -979,12 +979,12 @@ discard block |
||
| 979 | 979 | * |
| 980 | 980 | * @throws LexerException |
| 981 | 981 | */ |
| 982 | - public function parseSymbol(): Token|null |
|
| 982 | + public function parseSymbol(): Token | null |
|
| 983 | 983 | { |
| 984 | 984 | $token = $this->str[$this->last]; |
| 985 | 985 | $flags = Context::isSymbol($token); |
| 986 | 986 | |
| 987 | - if (! $flags) { |
|
| 987 | + if (!$flags) { |
|
| 988 | 988 | return null; |
| 989 | 989 | } |
| 990 | 990 | |
@@ -1026,14 +1026,14 @@ discard block |
||
| 1026 | 1026 | /** |
| 1027 | 1027 | * Parses unknown parts of the query. |
| 1028 | 1028 | */ |
| 1029 | - public function parseUnknown(): Token|null |
|
| 1029 | + public function parseUnknown(): Token | null |
|
| 1030 | 1030 | { |
| 1031 | 1031 | $token = $this->str[$this->last]; |
| 1032 | 1032 | if (Context::isSeparator($token)) { |
| 1033 | 1033 | return null; |
| 1034 | 1034 | } |
| 1035 | 1035 | |
| 1036 | - while (++$this->last < $this->len && ! Context::isSeparator($this->str[$this->last])) { |
|
| 1036 | + while (++$this->last < $this->len && !Context::isSeparator($this->str[$this->last])) { |
|
| 1037 | 1037 | $token .= $this->str[$this->last]; |
| 1038 | 1038 | |
| 1039 | 1039 | // Test if end of token equals the current delimiter. If so, remove it from the token. |
@@ -1052,7 +1052,7 @@ discard block |
||
| 1052 | 1052 | /** |
| 1053 | 1053 | * Parses the delimiter of the query. |
| 1054 | 1054 | */ |
| 1055 | - public function parseDelimiter(): Token|null |
|
| 1055 | + public function parseDelimiter(): Token | null |
|
| 1056 | 1056 | { |
| 1057 | 1057 | $idx = 0; |
| 1058 | 1058 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | * |
| 122 | 122 | * @param bool $end whether the end of the buffer was reached |
| 123 | 123 | */ |
| 124 | - public function extract($end = false): string|false |
|
| 124 | + public function extract($end = false): string | false |
|
| 125 | 125 | { |
| 126 | 126 | /** |
| 127 | 127 | * The last parsed position. |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | |
| 314 | 314 | // Parsing the delimiter. |
| 315 | 315 | $delimiter = ''; |
| 316 | - while (($i < $len) && (! Context::isWhitespace($this->query[$i]))) { |
|
| 316 | + while (($i < $len) && (!Context::isWhitespace($this->query[$i]))) { |
|
| 317 | 317 | $delimiter .= $this->query[$i++]; |
| 318 | 318 | } |
| 319 | 319 | |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | |
| 329 | 329 | // Whether this statement should be returned or not. |
| 330 | 330 | $ret = ''; |
| 331 | - if (! empty($this->options['parse_delimiter'])) { |
|
| 331 | + if (!empty($this->options['parse_delimiter'])) { |
|
| 332 | 332 | // Appending the `DELIMITER` statement that was just |
| 333 | 333 | // found to the current statement. |
| 334 | 334 | $ret = trim( |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | $ret = $this->current; |
| 372 | 372 | |
| 373 | 373 | // If needed, adds a delimiter at the end of the statement. |
| 374 | - if (! empty($this->options['add_delimiter'])) { |
|
| 374 | + if (!empty($this->options['add_delimiter'])) { |
|
| 375 | 375 | $ret .= $this->delimiter; |
| 376 | 376 | } |
| 377 | 377 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public static function getForeignKeys($statement): array |
| 25 | 25 | { |
| 26 | - if (empty($statement->fields) || (! is_array($statement->fields)) || (! $statement->options->has('TABLE'))) { |
|
| 26 | + if (empty($statement->fields) || (!is_array($statement->fields)) || (!$statement->options->has('TABLE'))) { |
|
| 27 | 27 | return []; |
| 28 | 28 | } |
| 29 | 29 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | $columns = []; |
| 38 | 38 | foreach ($field->key->columns as $column) { |
| 39 | - if (! isset($column['name'])) { |
|
| 39 | + if (!isset($column['name'])) { |
|
| 40 | 40 | continue; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | 'index_list' => $columns, |
| 49 | 49 | ]; |
| 50 | 50 | |
| 51 | - if (! empty($field->references)) { |
|
| 51 | + if (!empty($field->references)) { |
|
| 52 | 52 | $tmp['ref_db_name'] = $field->references->table->database; |
| 53 | 53 | $tmp['ref_table_name'] = $field->references->table->table; |
| 54 | 54 | $tmp['ref_index_list'] = $field->references->columns; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public static function getFields($statement): array |
| 83 | 83 | { |
| 84 | - if (empty($statement->fields) || (! is_array($statement->fields)) || (! $statement->options->has('TABLE'))) { |
|
| 84 | + if (empty($statement->fields) || (!is_array($statement->fields)) || (!$statement->options->has('TABLE'))) { |
|
| 85 | 85 | return []; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | 'timestamp_not_null' => false, |
| 99 | 99 | ]; |
| 100 | 100 | |
| 101 | - if (! $field->options) { |
|
| 101 | + if (!$field->options) { |
|
| 102 | 102 | continue; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $option = $field->options->has('AS'); |
| 127 | 127 | |
| 128 | - if (! $option) { |
|
| 128 | + if (!$option) { |
|
| 129 | 129 | continue; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -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 int|int[] $type the type |
| 133 | 133 | */ |
| 134 | - public function getPreviousOfType($type): Token|null |
|
| 134 | + public function getPreviousOfType($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 int|int[] $type the type |
| 153 | 153 | */ |
| 154 | - public function getNextOfType($type): Token|null |
|
| 154 | + public function getNextOfType($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 int $type the type of the token |
| 173 | 173 | * @param string $value the value of the token |
| 174 | 174 | */ |
| 175 | - public function getNextOfTypeAndValue($type, $value): Token|null |
|
| 175 | + public function getNextOfTypeAndValue($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 int $type the type of the token |
| 190 | 190 | * @param int $flag the flag of the token |
| 191 | 191 | */ |
| 192 | - public function getNextOfTypeAndFlag(int $type, int $flag): Token|null |
|
| 192 | + public function getNextOfTypeAndFlag(int $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 | } |
@@ -357,13 +357,13 @@ discard block |
||
| 357 | 357 | * |
| 358 | 358 | * @param bool $isReserved checks if the keyword is reserved |
| 359 | 359 | */ |
| 360 | - public static function isKeyword(string $string, bool $isReserved = false): int|null |
|
| 360 | + public static function isKeyword(string $string, bool $isReserved = false): int | null |
|
| 361 | 361 | { |
| 362 | 362 | $upperString = strtoupper($string); |
| 363 | 363 | |
| 364 | 364 | if ( |
| 365 | - ! isset(static::$keywords[$upperString]) |
|
| 366 | - || ($isReserved && ! (static::$keywords[$upperString] & Token::FLAG_KEYWORD_RESERVED)) |
|
| 365 | + !isset(static::$keywords[$upperString]) |
|
| 366 | + || ($isReserved && !(static::$keywords[$upperString] & Token::FLAG_KEYWORD_RESERVED)) |
|
| 367 | 367 | ) { |
| 368 | 368 | return null; |
| 369 | 369 | } |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | /** |
| 375 | 375 | * Checks if the given string is an operator and returns the appropriate flag for the operator. |
| 376 | 376 | */ |
| 377 | - public static function isOperator(string $string): int|null |
|
| 377 | + public static function isOperator(string $string): int | null |
|
| 378 | 378 | { |
| 379 | 379 | return static::$operators[$string] ?? null; |
| 380 | 380 | } |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | * |
| 393 | 393 | * @return int|null the appropriate flag for the comment type |
| 394 | 394 | */ |
| 395 | - public static function isComment(string $string, bool $end = false): int|null |
|
| 395 | + public static function isComment(string $string, bool $end = false): int | null |
|
| 396 | 396 | { |
| 397 | 397 | if ($string === '') { |
| 398 | 398 | return null; |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | * |
| 456 | 456 | * @return int|null the appropriate flag for the symbol type |
| 457 | 457 | */ |
| 458 | - public static function isSymbol(string $string): int|null |
|
| 458 | + public static function isSymbol(string $string): int | null |
|
| 459 | 459 | { |
| 460 | 460 | if ($string === '') { |
| 461 | 461 | return null; |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | * |
| 484 | 484 | * @return int|null the appropriate flag for the string type |
| 485 | 485 | */ |
| 486 | - public static function isString(string $string): int|null |
|
| 486 | + public static function isString(string $string): int | null |
|
| 487 | 487 | { |
| 488 | 488 | if ($string === '') { |
| 489 | 489 | return null; |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | $context = self::$contextPrefix . $context; |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | - if (! class_exists($context)) { |
|
| 540 | + if (!class_exists($context)) { |
|
| 541 | 541 | return false; |
| 542 | 542 | } |
| 543 | 543 | |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | * |
| 560 | 560 | * @return string|null The loaded context. `null` if no context was loaded. |
| 561 | 561 | */ |
| 562 | - public static function loadClosest(string $context = ''): string|null |
|
| 562 | + public static function loadClosest(string $context = ''): string | null |
|
| 563 | 563 | { |
| 564 | 564 | $length = strlen($context); |
| 565 | 565 | for ($i = $length; $i > 0;) { |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | $i -= 2; |
| 574 | 574 | $part = substr($context, $i, 2); |
| 575 | 575 | /* No more numeric parts to strip */ |
| 576 | - if (! is_numeric($part)) { |
|
| 576 | + if (!is_numeric($part)) { |
|
| 577 | 577 | break 2; |
| 578 | 578 | } |
| 579 | 579 | } while (intval($part) === 0 && $i > 0); |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | */ |
| 674 | 674 | public static function escape(string $str, string $quote = '`'): string |
| 675 | 675 | { |
| 676 | - if ((static::$mode & self::SQL_MODE_NO_ENCLOSING_QUOTES) && (! static::isKeyword($str, true))) { |
|
| 676 | + if ((static::$mode & self::SQL_MODE_NO_ENCLOSING_QUOTES) && (!static::isKeyword($str, true))) { |
|
| 677 | 677 | return $str; |
| 678 | 678 | } |
| 679 | 679 | |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | * |
| 718 | 718 | * @return bool false on empty param, true/false on given constant/int value |
| 719 | 719 | */ |
| 720 | - public static function hasMode(int|null $flag = null): bool |
|
| 720 | + public static function hasMode(int | null $flag = null): bool |
|
| 721 | 721 | { |
| 722 | 722 | if (empty($flag)) { |
| 723 | 723 | return false; |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | public static function gettext($msgid): string |
| 67 | 67 | { |
| 68 | - if (! class_exists(Loader::class, true)) { |
|
| 68 | + if (!class_exists(Loader::class, true)) { |
|
| 69 | 69 | return $msgid; |
| 70 | 70 | } |
| 71 | 71 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * @param TokensList $list the list of tokens that are being parsed |
| 95 | 95 | * @param array<string, mixed> $options parameters for parsing |
| 96 | 96 | */ |
| 97 | - public static function parse(Parser $parser, TokensList $list, array $options = []): DataType|null |
|
| 97 | + public static function parse(Parser $parser, TokensList $list, array $options = []): DataType | null |
|
| 98 | 98 | { |
| 99 | 99 | $ret = new static(); |
| 100 | 100 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | if ($state === 0) { |
| 126 | 126 | $ret->name = strtoupper((string) $token->value); |
| 127 | - if (($token->type !== Token::TYPE_KEYWORD) || (! ($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) { |
|
| 127 | + if (($token->type !== Token::TYPE_KEYWORD) || (!($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) { |
|
| 128 | 128 | $parser->error('Unrecognized data type.', $token); |
| 129 | 129 | } |
| 130 | 130 | |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | * |
| 50 | 50 | * @return ArrayObj|Component[] |
| 51 | 51 | */ |
| 52 | - public static function parse(Parser $parser, TokensList $list, array $options = []): ArrayObj|array |
|
| 52 | + public static function parse(Parser $parser, TokensList $list, array $options = []): ArrayObj | array |
|
| 53 | 53 | { |
| 54 | 54 | $ret = empty($options['type']) ? new static() : []; |
| 55 | 55 | |