@@ -48,13 +48,13 @@ public function tokenize(string $expression)
48
48
}
49
49
$ tokens [] = new Token (Token::NUMBER_TYPE , $ number , $ cursor + 1 );
50
50
$ cursor += \strlen ($ match [0 ]);
51
- } elseif (false !== strpos ('([{ ' , $ expression [$ cursor ])) {
51
+ } elseif (str_contains ('([{ ' , $ expression [$ cursor ])) {
52
52
// opening bracket
53
53
$ brackets [] = [$ expression [$ cursor ], $ cursor ];
54
54
55
55
$ tokens [] = new Token (Token::PUNCTUATION_TYPE , $ expression [$ cursor ], $ cursor + 1 );
56
56
++$ cursor ;
57
- } elseif (false !== strpos (')]} ' , $ expression [$ cursor ])) {
57
+ } elseif (str_contains (')]} ' , $ expression [$ cursor ])) {
58
58
// closing bracket
59
59
if (empty ($ brackets )) {
60
60
throw new SyntaxError (sprintf ('Unexpected "%s". ' , $ expression [$ cursor ]), $ cursor , $ expression );
@@ -75,7 +75,7 @@ public function tokenize(string $expression)
75
75
// operators
76
76
$ tokens [] = new Token (Token::OPERATOR_TYPE , $ match [0 ], $ cursor + 1 );
77
77
$ cursor += \strlen ($ match [0 ]);
78
- } elseif (false !== strpos ('.,?: ' , $ expression [$ cursor ])) {
78
+ } elseif (str_contains ('.,?: ' , $ expression [$ cursor ])) {
79
79
// punctuation
80
80
$ tokens [] = new Token (Token::PUNCTUATION_TYPE , $ expression [$ cursor ], $ cursor + 1 );
81
81
++$ cursor ;
0 commit comments