Skip to content

Commit

Permalink
PHPCS 4.x | Tokenizer/PHP: defer to predefined regex
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Nov 9, 2023
1 parent 74c422f commit d8b4a31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Tokenizers/PHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ protected function tokenize($string)

if ($tokenIsArray === true
&& ($token[0] === T_STRING
|| preg_match('`^[a-zA-Z_\x80-\xff]`', $token[1]) === 1)
|| preg_match(self::PHP_LABEL_REGEX, $token[1]) === 1)
) {
// Get the next non-empty token.
for ($i = ($stackPtr + 1); $i < $numTokens; $i++) {
Expand Down

0 comments on commit d8b4a31

Please sign in to comment.