Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jun 8, 2024
1 parent 49faf48 commit d61a6e6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Tokenizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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)
);
}

Expand Down Expand Up @@ -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]);
Expand All @@ -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]))
);
}

Expand All @@ -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]))
);
}

Expand All @@ -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]))
);
}
}
Expand All @@ -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]))
);
}

Expand Down Expand Up @@ -1050,7 +1050,7 @@ private function getNextQuotedString(string $string, int $offset): string
$string,
$matches,
0,
$offset,
$offset
)
) {
$ret = $matches[0];
Expand Down

0 comments on commit d61a6e6

Please sign in to comment.