Skip to content

Commit c63bdf3

Browse files
TysonAndrefabpot
authored andcommitted
Fix minor phpdoc mismatches with the code(detected by phan)
1 parent 312e912 commit c63bdf3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Lexer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function tokenize($expression)
4242
continue;
4343
}
4444

45-
if (preg_match('/[0-9]+(?:\.[0-9]+)?/A', $expression, $match, null, $cursor)) {
45+
if (preg_match('/[0-9]+(?:\.[0-9]+)?/A', $expression, $match, 0, $cursor)) {
4646
// numbers
4747
$number = (float) $match[0]; // floats
4848
if (preg_match('/^[0-9]+$/', $match[0]) && $number <= PHP_INT_MAX) {
@@ -69,19 +69,19 @@ public function tokenize($expression)
6969

7070
$tokens[] = new Token(Token::PUNCTUATION_TYPE, $expression[$cursor], $cursor + 1);
7171
++$cursor;
72-
} elseif (preg_match('/"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As', $expression, $match, null, $cursor)) {
72+
} elseif (preg_match('/"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As', $expression, $match, 0, $cursor)) {
7373
// strings
7474
$tokens[] = new Token(Token::STRING_TYPE, stripcslashes(substr($match[0], 1, -1)), $cursor + 1);
7575
$cursor += strlen($match[0]);
76-
} elseif (preg_match('/not in(?=[\s(])|\!\=\=|not(?=[\s(])|and(?=[\s(])|\=\=\=|\>\=|or(?=[\s(])|\<\=|\*\*|\.\.|in(?=[\s(])|&&|\|\||matches|\=\=|\!\=|\*|~|%|\/|\>|\||\!|\^|&|\+|\<|\-/A', $expression, $match, null, $cursor)) {
76+
} elseif (preg_match('/not in(?=[\s(])|\!\=\=|not(?=[\s(])|and(?=[\s(])|\=\=\=|\>\=|or(?=[\s(])|\<\=|\*\*|\.\.|in(?=[\s(])|&&|\|\||matches|\=\=|\!\=|\*|~|%|\/|\>|\||\!|\^|&|\+|\<|\-/A', $expression, $match, 0, $cursor)) {
7777
// operators
7878
$tokens[] = new Token(Token::OPERATOR_TYPE, $match[0], $cursor + 1);
7979
$cursor += strlen($match[0]);
8080
} elseif (false !== strpos('.,?:', $expression[$cursor])) {
8181
// punctuation
8282
$tokens[] = new Token(Token::PUNCTUATION_TYPE, $expression[$cursor], $cursor + 1);
8383
++$cursor;
84-
} elseif (preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A', $expression, $match, null, $cursor)) {
84+
} elseif (preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A', $expression, $match, 0, $cursor)) {
8585
// names
8686
$tokens[] = new Token(Token::NAME_TYPE, $match[0], $cursor + 1);
8787
$cursor += strlen($match[0]);

Token.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Token
3232
/**
3333
* Constructor.
3434
*
35-
* @param int $type The type of the token
35+
* @param string $type The type of the token (self::*_TYPE)
3636
* @param string $value The token value
3737
* @param int $cursor The cursor position in the source
3838
*/

0 commit comments

Comments
 (0)