From d61a6e6169b6ec271b64445d0b18f77c62a9ea17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 8 Jun 2024 11:59:27 +0200 Subject: [PATCH] fix --- src/Tokenizer.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Tokenizer.php b/src/Tokenizer.php index 1fe6569..7ff79fc 100644 --- a/src/Tokenizer.php +++ b/src/Tokenizer.php @@ -877,7 +877,7 @@ public function tokenize(string $string): Cursor * @param string $upper The SQL string in upper case * @param Token|null $previous The result of the previous createNextToken() call */ - private function createNextToken(string $string, string $upper, int $offset, Token|null $previous = null): Token + private function createNextToken(string $string, string $upper, int $offset, ?Token $previous = null): Token { // Whitespace if (preg_match('/\G\s+/', $string, $matches, 0, $offset)) { @@ -918,7 +918,7 @@ private function createNextToken(string $string, string $upper, int $offset, Tok ($firstChar === '`' || $firstChar === '[' ? Token::TOKEN_TYPE_BACKTICK_QUOTE : Token::TOKEN_TYPE_QUOTE), - $this->getNextQuotedString($string, $offset), + $this->getNextQuotedString($string, $offset) ); } @@ -950,7 +950,7 @@ private function createNextToken(string $string, string $upper, int $offset, Tok $string, $matches, 0, - $offset, + $offset ) ) { return new Token(Token::TOKEN_TYPE_NUMBER, $matches[0]); @@ -971,12 +971,12 @@ private function createNextToken(string $string, string $upper, int $offset, Tok $upper, $matches, 0, - $offset, + $offset ) ) { return new Token( Token::TOKEN_TYPE_RESERVED_TOPLEVEL, - substr($string, $offset, strlen($matches[0])), + substr($string, $offset, strlen($matches[0])) ); } @@ -987,12 +987,12 @@ private function createNextToken(string $string, string $upper, int $offset, Tok $upper, $matches, 0, - $offset, + $offset ) ) { return new Token( Token::TOKEN_TYPE_RESERVED_NEWLINE, - substr($string, $offset, strlen($matches[0])), + substr($string, $offset, strlen($matches[0])) ); } @@ -1003,12 +1003,12 @@ private function createNextToken(string $string, string $upper, int $offset, Tok $upper, $matches, 0, - $offset, + $offset ) ) { return new Token( Token::TOKEN_TYPE_RESERVED, - substr($string, $offset, strlen($matches[0])), + substr($string, $offset, strlen($matches[0])) ); } } @@ -1018,7 +1018,7 @@ private function createNextToken(string $string, string $upper, int $offset, Tok if (preg_match(self::$nextTokenRegexFunction, $upper, $matches, 0, $offset)) { return new Token( Token::TOKEN_TYPE_RESERVED, - substr($string, $offset, strlen($matches[0])), + substr($string, $offset, strlen($matches[0])) ); } @@ -1050,7 +1050,7 @@ private function getNextQuotedString(string $string, int $offset): string $string, $matches, 0, - $offset, + $offset ) ) { $ret = $matches[0];