Skip to content

Commit 4809d13

Browse files
committed
Add support for PostgreSQL cast operator - better solution
1 parent db71431 commit 4809d13

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Tokenizer.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ final class Tokenizer
710710
private $boundaries = [
711711
',',
712712
';',
713+
'::', // PostgreSQL cast operator
713714
':',
714715
')',
715716
'(',
@@ -857,11 +858,6 @@ private function createNextToken(string $string, ?Token $previous = null): Token
857858
);
858859
}
859860

860-
// PostgreSQL cast operator
861-
if (substr($string, 0, 2) === '::') {
862-
return new Token(Token::TOKEN_TYPE_BOUNDARY, '::');
863-
}
864-
865861
// User-defined Variable
866862
if (($string[0] === '@' || $string[0] === ':') && isset($string[1])) {
867863
$value = null;

0 commit comments

Comments
 (0)