@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * enabled or not |
128 | 128 | * @param string $delimiter the delimiter to be used |
129 | 129 | */ |
130 | - public function __construct(string|UtfString $str, bool $strict = false, string|null $delimiter = null) |
|
130 | + public function __construct(string | UtfString $str, bool $strict = false, string | null $delimiter = null) |
|
131 | 131 | { |
132 | 132 | if (Context::$keywords === []) { |
133 | 133 | Context::load(); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $len = $str instanceof UtfString ? $str->length() : strlen($str); |
139 | 139 | |
140 | 140 | // For multi-byte strings, a new instance of `UtfString` is initialized. |
141 | - if (! $str instanceof UtfString && $len !== mb_strlen($str, 'UTF-8')) { |
|
141 | + if (!$str instanceof UtfString && $len !== mb_strlen($str, 'UTF-8')) { |
|
142 | 142 | $str = new UtfString($str); |
143 | 143 | } |
144 | 144 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $this->strict = $strict; |
149 | 149 | |
150 | 150 | // Setting the delimiter. |
151 | - $this->setDelimiter(! empty($delimiter) ? $delimiter : static::$defaultDelimiter); |
|
151 | + $this->setDelimiter(!empty($delimiter) ? $delimiter : static::$defaultDelimiter); |
|
152 | 152 | |
153 | 153 | $this->lex(); |
154 | 154 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $delimiterLen = 0; |
258 | 258 | while ( |
259 | 259 | ++$this->last < $this->len |
260 | - && ! Context::isWhitespace($this->str[$this->last]) |
|
260 | + && !Context::isWhitespace($this->str[$this->last]) |
|
261 | 261 | && $delimiterLen < 15 |
262 | 262 | ) { |
263 | 263 | $this->delimiter .= $this->str[$this->last]; |
@@ -316,8 +316,8 @@ discard block |
||
316 | 316 | } |
317 | 317 | |
318 | 318 | if ( |
319 | - ($next->type !== TokenType::Keyword || ! in_array($next->value, ['FROM', 'USING'], true)) |
|
320 | - && ($next->type !== TokenType::Operator || ! in_array($next->value, [',', ')'], true)) |
|
319 | + ($next->type !== TokenType::Keyword || !in_array($next->value, ['FROM', 'USING'], true)) |
|
320 | + && ($next->type !== TokenType::Operator || !in_array($next->value, [',', ')'], true)) |
|
321 | 321 | ) { |
322 | 322 | continue; |
323 | 323 | } |
@@ -355,10 +355,10 @@ discard block |
||
355 | 355 | $next = $this->list->getNext(); |
356 | 356 | if ( |
357 | 357 | ($next->type !== TokenType::Keyword |
358 | - || ! in_array($next->value, self::KEYWORD_NAME_INDICATORS, true) |
|
358 | + || !in_array($next->value, self::KEYWORD_NAME_INDICATORS, true) |
|
359 | 359 | ) |
360 | 360 | && ($next->type !== TokenType::Operator |
361 | - || ! in_array($next->value, self::OPERATOR_NAME_INDICATORS, true) |
|
361 | + || !in_array($next->value, self::OPERATOR_NAME_INDICATORS, true) |
|
362 | 362 | ) |
363 | 363 | && ($next->value !== '') |
364 | 364 | ) { |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | /** |
403 | 403 | * Parses a keyword. |
404 | 404 | */ |
405 | - public function parseKeyword(): Token|null |
|
405 | + public function parseKeyword(): Token | null |
|
406 | 406 | { |
407 | 407 | $token = ''; |
408 | 408 | |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | $token .= $this->str[$this->last]; |
443 | 443 | $flags = Context::isKeyword($token); |
444 | 444 | |
445 | - if (($this->last + 1 !== $this->len && ! Context::isSeparator($this->str[$this->last + 1])) || ! $flags) { |
|
445 | + if (($this->last + 1 !== $this->len && !Context::isSeparator($this->str[$this->last + 1])) || !$flags) { |
|
446 | 446 | continue; |
447 | 447 | } |
448 | 448 | |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | /** |
463 | 463 | * Parses a label. |
464 | 464 | */ |
465 | - public function parseLabel(): Token|null |
|
465 | + public function parseLabel(): Token | null |
|
466 | 466 | { |
467 | 467 | $token = ''; |
468 | 468 | |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | /** |
507 | 507 | * Parses an operator. |
508 | 508 | */ |
509 | - public function parseOperator(): Token|null |
|
509 | + public function parseOperator(): Token | null |
|
510 | 510 | { |
511 | 511 | $token = ''; |
512 | 512 | |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | $token .= $this->str[$this->last]; |
527 | 527 | $flags = Context::isOperator($token); |
528 | 528 | |
529 | - if (! $flags) { |
|
529 | + if (!$flags) { |
|
530 | 530 | continue; |
531 | 531 | } |
532 | 532 | |
@@ -542,11 +542,11 @@ discard block |
||
542 | 542 | /** |
543 | 543 | * Parses a whitespace. |
544 | 544 | */ |
545 | - public function parseWhitespace(): Token|null |
|
545 | + public function parseWhitespace(): Token | null |
|
546 | 546 | { |
547 | 547 | $token = $this->str[$this->last]; |
548 | 548 | |
549 | - if (! Context::isWhitespace($token)) { |
|
549 | + if (!Context::isWhitespace($token)) { |
|
550 | 550 | return null; |
551 | 551 | } |
552 | 552 | |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | /** |
563 | 563 | * Parses a comment. |
564 | 564 | */ |
565 | - public function parseComment(): Token|null |
|
565 | + public function parseComment(): Token | null |
|
566 | 566 | { |
567 | 567 | $iBak = $this->last; |
568 | 568 | $token = $this->str[$this->last]; |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | /** |
680 | 680 | * Parses a boolean. |
681 | 681 | */ |
682 | - public function parseBool(): Token|null |
|
682 | + public function parseBool(): Token | null |
|
683 | 683 | { |
684 | 684 | if ($this->last + 3 >= $this->len) { |
685 | 685 | // At least `min(strlen('TRUE'), strlen('FALSE'))` characters are |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | /** |
711 | 711 | * Parses a number. |
712 | 712 | */ |
713 | - public function parseNumber(): Token|null |
|
713 | + public function parseNumber(): Token | null |
|
714 | 714 | { |
715 | 715 | // A rudimentary state machine is being used to parse numbers due to |
716 | 716 | // the various forms of their notation. |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | } elseif ($state === 2) { |
778 | 778 | $flags |= Token::FLAG_NUMBER_HEX; |
779 | 779 | if ( |
780 | - ! ( |
|
780 | + !( |
|
781 | 781 | ($this->str[$this->last] >= '0' && $this->str[$this->last] <= '9') |
782 | 782 | || ($this->str[$this->last] >= 'A' && $this->str[$this->last] <= 'F') |
783 | 783 | || ($this->str[$this->last] >= 'a' && $this->str[$this->last] <= 'f') |
@@ -873,12 +873,12 @@ discard block |
||
873 | 873 | * |
874 | 874 | * @throws LexerException |
875 | 875 | */ |
876 | - public function parseString(string $quote = ''): Token|null |
|
876 | + public function parseString(string $quote = ''): Token | null |
|
877 | 877 | { |
878 | 878 | $token = $this->str[$this->last]; |
879 | 879 | $flags = Context::isString($token); |
880 | 880 | |
881 | - if (! $flags && $token !== $quote) { |
|
881 | + if (!$flags && $token !== $quote) { |
|
882 | 882 | return null; |
883 | 883 | } |
884 | 884 | |
@@ -923,12 +923,12 @@ discard block |
||
923 | 923 | * |
924 | 924 | * @throws LexerException |
925 | 925 | */ |
926 | - public function parseSymbol(): Token|null |
|
926 | + public function parseSymbol(): Token | null |
|
927 | 927 | { |
928 | 928 | $token = $this->str[$this->last]; |
929 | 929 | $flags = Context::isSymbol($token); |
930 | 930 | |
931 | - if (! $flags) { |
|
931 | + if (!$flags) { |
|
932 | 932 | return null; |
933 | 933 | } |
934 | 934 | |
@@ -954,7 +954,7 @@ discard block |
||
954 | 954 | if ($str === null) { |
955 | 955 | $str = $this->parseUnknown(); |
956 | 956 | |
957 | - if ($str === null && ! ($flags & Token::FLAG_SYMBOL_PARAMETER)) { |
|
957 | + if ($str === null && !($flags & Token::FLAG_SYMBOL_PARAMETER)) { |
|
958 | 958 | $this->error('Variable name was expected.', $this->str[$this->last], $this->last); |
959 | 959 | } |
960 | 960 | } |
@@ -970,14 +970,14 @@ discard block |
||
970 | 970 | /** |
971 | 971 | * Parses unknown parts of the query. |
972 | 972 | */ |
973 | - public function parseUnknown(): Token|null |
|
973 | + public function parseUnknown(): Token | null |
|
974 | 974 | { |
975 | 975 | $token = $this->str[$this->last]; |
976 | 976 | if (Context::isSeparator($token)) { |
977 | 977 | return null; |
978 | 978 | } |
979 | 979 | |
980 | - while (++$this->last < $this->len && ! Context::isSeparator($this->str[$this->last])) { |
|
980 | + while (++$this->last < $this->len && !Context::isSeparator($this->str[$this->last])) { |
|
981 | 981 | $token .= $this->str[$this->last]; |
982 | 982 | |
983 | 983 | // Test if end of token equals the current delimiter. If so, remove it from the token. |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | /** |
997 | 997 | * Parses the delimiter of the query. |
998 | 998 | */ |
999 | - public function parseDelimiter(): Token|null |
|
999 | + public function parseDelimiter(): Token | null |
|
1000 | 1000 | { |
1001 | 1001 | $idx = 0; |
1002 | 1002 | |
@@ -1013,7 +1013,7 @@ discard block |
||
1013 | 1013 | return new Token($this->delimiter, TokenType::Delimiter); |
1014 | 1014 | } |
1015 | 1015 | |
1016 | - private function parse(): Token|null |
|
1016 | + private function parse(): Token | null |
|
1017 | 1017 | { |
1018 | 1018 | // It is best to put the parsers in order of their complexity |
1019 | 1019 | // (ascending) and their occurrence rate (descending). |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | /** |
63 | 63 | * The current status of the parser. |
64 | 64 | */ |
65 | - public int|null $status = null; |
|
65 | + public int | null $status = null; |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * The last incomplete query that was extracted. |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * |
110 | 110 | * @param bool $end whether the end of the buffer was reached |
111 | 111 | */ |
112 | - public function extract(bool $end = false): string|false |
|
112 | + public function extract(bool $end = false): string | false |
|
113 | 113 | { |
114 | 114 | /** |
115 | 115 | * The last parsed position. |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | |
302 | 302 | // Parsing the delimiter. |
303 | 303 | $delimiter = ''; |
304 | - while (($i < $len) && (! Context::isWhitespace($this->query[$i]))) { |
|
304 | + while (($i < $len) && (!Context::isWhitespace($this->query[$i]))) { |
|
305 | 305 | $delimiter .= $this->query[$i++]; |
306 | 306 | } |
307 | 307 | |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | |
317 | 317 | // Whether this statement should be returned or not. |
318 | 318 | $ret = ''; |
319 | - if (! empty($this->options['parse_delimiter'])) { |
|
319 | + if (!empty($this->options['parse_delimiter'])) { |
|
320 | 320 | // Appending the `DELIMITER` statement that was just |
321 | 321 | // found to the current statement. |
322 | 322 | $ret = trim( |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | $ret = $this->current; |
360 | 360 | |
361 | 361 | // If needed, adds a delimiter at the end of the statement. |
362 | - if (! empty($this->options['add_delimiter'])) { |
|
362 | + if (!empty($this->options['add_delimiter'])) { |
|
363 | 363 | $ret .= $this->delimiter; |
364 | 364 | } |
365 | 365 |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | /** |
356 | 356 | * The list of tokens that are parsed. |
357 | 357 | */ |
358 | - public TokensList|null $list = null; |
|
358 | + public TokensList | null $list = null; |
|
359 | 359 | |
360 | 360 | /** |
361 | 361 | * List of statements parsed. |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | * @param string|UtfString|TokensList|null $list the list of tokens to be parsed |
374 | 374 | * @param bool $strict whether strict mode should be enabled or not |
375 | 375 | */ |
376 | - public function __construct(string|UtfString|TokensList|null $list = null, bool $strict = false) |
|
376 | + public function __construct(string | UtfString | TokensList | null $list = null, bool $strict = false) |
|
377 | 377 | { |
378 | 378 | if (Context::$keywords === []) { |
379 | 379 | Context::load(); |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | $list->idx = $lastIdx; |
504 | 504 | } elseif (empty(self::STATEMENT_PARSERS[$token->keyword])) { |
505 | 505 | // Checking if it is a known statement that can be parsed. |
506 | - if (! isset(self::STATEMENT_PARSERS[$token->keyword])) { |
|
506 | + if (!isset(self::STATEMENT_PARSERS[$token->keyword])) { |
|
507 | 507 | // A statement is considered recognized if the parser |
508 | 508 | // is aware that it is a statement, but it does not have |
509 | 509 | // a parser for it yet. |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | |
544 | 544 | // Handles unions. |
545 | 545 | if ( |
546 | - ! empty($unionType) |
|
546 | + !empty($unionType) |
|
547 | 547 | && ($lastStatement instanceof SelectStatement) |
548 | 548 | && ($statement instanceof SelectStatement) |
549 | 549 | ) { |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | * |
631 | 631 | * @throws ParserException throws the exception, if strict mode is enabled. |
632 | 632 | */ |
633 | - public function error(string $msg, Token|null $token = null, int $code = 0): void |
|
633 | + public function error(string $msg, Token | null $token = null, int $code = 0): void |
|
634 | 634 | { |
635 | 635 | $error = new ParserException( |
636 | 636 | Translator::gettext($msg), |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public static function load(): void |
31 | 31 | { |
32 | - if (! isset(self::$loader)) { |
|
32 | + if (!isset(self::$loader)) { |
|
33 | 33 | // Create loader object |
34 | 34 | self::$loader = new Loader(); |
35 | 35 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public static function gettext(string $msgid): string |
64 | 64 | { |
65 | - if (! class_exists(Loader::class, true)) { |
|
65 | + if (!class_exists(Loader::class, true)) { |
|
66 | 66 | return $msgid; |
67 | 67 | } |
68 | 68 |
@@ -67,23 +67,23 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @see Statement::$statementOptions |
69 | 69 | */ |
70 | - public OptionsArray|null $options = null; |
|
70 | + public OptionsArray | null $options = null; |
|
71 | 71 | |
72 | 72 | /** |
73 | 73 | * The index of the first token used in this statement. |
74 | 74 | */ |
75 | - public int|null $first = null; |
|
75 | + public int | null $first = null; |
|
76 | 76 | |
77 | 77 | /** |
78 | 78 | * The index of the last token used in this statement. |
79 | 79 | */ |
80 | - public int|null $last = null; |
|
80 | + public int | null $last = null; |
|
81 | 81 | |
82 | 82 | /** |
83 | 83 | * @param Parser|null $parser the instance that requests parsing |
84 | 84 | * @param TokensList|null $list the list of tokens to be parsed |
85 | 85 | */ |
86 | - public function __construct(Parser|null $parser = null, TokensList|null $list = null) |
|
86 | + public function __construct(Parser | null $parser = null, TokensList | null $list = null) |
|
87 | 87 | { |
88 | 88 | if (($parser === null) || ($list === null)) { |
89 | 89 | return; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | // Checking if this field was already built. |
162 | 162 | if ($type & 1) { |
163 | - if (! empty($built[$field])) { |
|
163 | + if (!empty($built[$field])) { |
|
164 | 164 | continue; |
165 | 165 | } |
166 | 166 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | // Checking if the result of the builder should be added. |
176 | - if (! ($type & 1)) { |
|
176 | + if (!($type & 1)) { |
|
177 | 177 | continue; |
178 | 178 | } |
179 | 179 | |
@@ -299,8 +299,8 @@ discard block |
||
299 | 299 | $options = []; |
300 | 300 | |
301 | 301 | // Looking for duplicated clauses. |
302 | - if (! empty(Parser::KEYWORD_PARSERS[$token->value]) || ! empty(Parser::STATEMENT_PARSERS[$token->value])) { |
|
303 | - if (! empty($parsedClauses[$token->value])) { |
|
302 | + if (!empty(Parser::KEYWORD_PARSERS[$token->value]) || !empty(Parser::STATEMENT_PARSERS[$token->value])) { |
|
303 | + if (!empty($parsedClauses[$token->value])) { |
|
304 | 304 | $parser->error('This type of clause was previously parsed.', $token); |
305 | 305 | break; |
306 | 306 | } |
@@ -313,18 +313,18 @@ discard block |
||
313 | 313 | // but it might be the beginning of a statement of truncate, |
314 | 314 | // so let the value use the keyword field for truncate type. |
315 | 315 | $tokenValue = in_array($token->keyword, ['TRUNCATE']) ? $token->keyword : $token->value; |
316 | - if (! empty(Parser::KEYWORD_PARSERS[$tokenValue]) && $list->idx < $list->count) { |
|
316 | + if (!empty(Parser::KEYWORD_PARSERS[$tokenValue]) && $list->idx < $list->count) { |
|
317 | 317 | $class = Parser::KEYWORD_PARSERS[$tokenValue]['class']; |
318 | 318 | $field = Parser::KEYWORD_PARSERS[$tokenValue]['field']; |
319 | - if (! empty(Parser::KEYWORD_PARSERS[$tokenValue]['options'])) { |
|
319 | + if (!empty(Parser::KEYWORD_PARSERS[$tokenValue]['options'])) { |
|
320 | 320 | $options = Parser::KEYWORD_PARSERS[$tokenValue]['options']; |
321 | 321 | } |
322 | 322 | } |
323 | 323 | |
324 | 324 | // Checking if this is the beginning of the statement. |
325 | - if (! empty(Parser::STATEMENT_PARSERS[$token->keyword])) { |
|
325 | + if (!empty(Parser::STATEMENT_PARSERS[$token->keyword])) { |
|
326 | 326 | if ( |
327 | - ! empty(static::$clauses) // Undefined for some statements. |
|
327 | + !empty(static::$clauses) // Undefined for some statements. |
|
328 | 328 | && empty(static::$clauses[$token->value]) |
329 | 329 | ) { |
330 | 330 | // Some keywords (e.g. `SET`) may be the beginning of a |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | break; |
340 | 340 | } |
341 | 341 | |
342 | - if (! $parsedOptions) { |
|
342 | + if (!$parsedOptions) { |
|
343 | 343 | if (empty(static::$statementOptions[$token->value])) { |
344 | 344 | // Skipping keyword because if it is not a option. |
345 | 345 | ++$list->idx; |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | if ($minJoin === 0 && stripos($clauseType, 'JOIN')) { |
513 | 513 | // First JOIN clause is detected |
514 | 514 | $minJoin = $maxJoin = $clauseStartIdx; |
515 | - } elseif ($minJoin !== 0 && ! stripos($clauseType, 'JOIN')) { |
|
515 | + } elseif ($minJoin !== 0 && !stripos($clauseType, 'JOIN')) { |
|
516 | 516 | // After a previous JOIN clause, a non-JOIN clause has been detected |
517 | 517 | $maxJoin = $lastIdx; |
518 | 518 | } elseif ($maxJoin < $clauseStartIdx && stripos($clauseType, 'JOIN')) { |
@@ -99,38 +99,38 @@ |
||
99 | 99 | * |
100 | 100 | * @var Expression[]|null |
101 | 101 | */ |
102 | - public array|null $tables = null; |
|
102 | + public array | null $tables = null; |
|
103 | 103 | |
104 | 104 | /** |
105 | 105 | * The updated values. |
106 | 106 | * |
107 | 107 | * @var SetOperation[]|null |
108 | 108 | */ |
109 | - public array|null $set = null; |
|
109 | + public array | null $set = null; |
|
110 | 110 | |
111 | 111 | /** |
112 | 112 | * Conditions used for filtering each row of the result set. |
113 | 113 | * |
114 | 114 | * @var Condition[]|null |
115 | 115 | */ |
116 | - public array|null $where = null; |
|
116 | + public array | null $where = null; |
|
117 | 117 | |
118 | 118 | /** |
119 | 119 | * Specifies the order of the rows in the result set. |
120 | 120 | * |
121 | 121 | * @var OrderKeyword[]|null |
122 | 122 | */ |
123 | - public array|null $order = null; |
|
123 | + public array | null $order = null; |
|
124 | 124 | |
125 | 125 | /** |
126 | 126 | * Conditions used for limiting the size of the result set. |
127 | 127 | */ |
128 | - public Limit|null $limit = null; |
|
128 | + public Limit | null $limit = null; |
|
129 | 129 | |
130 | 130 | /** |
131 | 131 | * Joins. |
132 | 132 | * |
133 | 133 | * @var JoinKeyword[]|null |
134 | 134 | */ |
135 | - public array|null $join = null; |
|
135 | + public array | null $join = null; |
|
136 | 136 | } |
@@ -33,5 +33,5 @@ |
||
33 | 33 | * |
34 | 34 | * @var Expression[]|null |
35 | 35 | */ |
36 | - public array|null $tables = null; |
|
36 | + public array | null $tables = null; |
|
37 | 37 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | /** |
63 | 63 | * holds the CTE parser. |
64 | 64 | */ |
65 | - public Parser|null $cteStatementParser = null; |
|
65 | + public Parser | null $cteStatementParser = null; |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * @param Parser $parser the instance that requests parsing |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | |
112 | 112 | if ($state === 0) { |
113 | - if ($token->type !== TokenType::None || ! preg_match('/^[a-zA-Z0-9_$]+$/', $token->token)) { |
|
113 | + if ($token->type !== TokenType::None || !preg_match('/^[a-zA-Z0-9_$]+$/', $token->token)) { |
|
114 | 114 | $parser->error('The name of the CTE was expected.', $token); |
115 | 115 | break; |
116 | 116 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | break; |
135 | 135 | } |
136 | 136 | } elseif ($state === 2) { |
137 | - if (! ($token->type === TokenType::Keyword && $token->keyword === 'AS')) { |
|
137 | + if (!($token->type === TokenType::Keyword && $token->keyword === 'AS')) { |
|
138 | 138 | $parser->error('AS keyword was expected.', $token); |
139 | 139 | break; |
140 | 140 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $list->idx++; // Ignore the current token |
147 | 147 | $nextKeyword = $list->getNext(); |
148 | 148 | |
149 | - if (! ($token->value === '(' && ($nextKeyword && $nextKeyword->value === 'SELECT'))) { |
|
149 | + if (!($token->value === '(' && ($nextKeyword && $nextKeyword->value === 'SELECT'))) { |
|
150 | 150 | $parser->error('Subquery of the CTE was expected.', $token); |
151 | 151 | $list->idx = $idxBeforeGetNext; |
152 | 152 | break; |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | /** |
294 | 294 | * Get tokens within the WITH expression to use them in another parser |
295 | 295 | */ |
296 | - private function getSubTokenList(TokensList $list): ParserException|TokensList |
|
296 | + private function getSubTokenList(TokensList $list): ParserException | TokensList |
|
297 | 297 | { |
298 | 298 | $idx = $list->idx; |
299 | 299 | $token = $list->tokens[$list->idx]; |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | } |
310 | 310 | |
311 | 311 | ++$list->idx; |
312 | - if (! isset($list->tokens[$list->idx])) { |
|
312 | + if (!isset($list->tokens[$list->idx])) { |
|
313 | 313 | break; |
314 | 314 | } |
315 | 315 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | /** |
35 | 35 | * The parser of the statement to be explained |
36 | 36 | */ |
37 | - public Parser|null $bodyParser = null; |
|
37 | + public Parser | null $bodyParser = null; |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * The statement alias, could be any of the following: |
@@ -47,22 +47,22 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * The connection identifier, if used. |
49 | 49 | */ |
50 | - public int|null $connectionId = null; |
|
50 | + public int | null $connectionId = null; |
|
51 | 51 | |
52 | 52 | /** |
53 | 53 | * The explained database for the table's name, if used. |
54 | 54 | */ |
55 | - public string|null $explainedDatabase = null; |
|
55 | + public string | null $explainedDatabase = null; |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * The explained table's name, if used. |
59 | 59 | */ |
60 | - public string|null $explainedTable = null; |
|
60 | + public string | null $explainedTable = null; |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * The explained column's name, if used. |
64 | 64 | */ |
65 | - public string|null $explainedColumn = null; |
|
65 | + public string | null $explainedColumn = null; |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * @param Parser $parser the instance that requests parsing |