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