Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhpParser\Lexer::getNextToken(): Return value must be of type int, null returned #459

Open
metalmumu opened this issue Jun 9, 2021 · 1 comment

Comments

@metalmumu
Copy link

Bug report

Fatal Error

 $ phpmetrics.phar ./
... 14% ...PHP Warning:  Undefined array key 314 in phar:///opt/php-tools/phpmetrics.phar/vendor/nikic/php-parser/lib/PhpParser/Lexer.php on line 293
PHP Fatal error:  Uncaught TypeError: PhpParser\Lexer::getNextToken(): Return value must be of type int, null returned in phar:///opt/php-tools/phpmetrics.phar/vendor/nikic/php-parser/lib/PhpParser/Lexer.php:333
Stack trace:
#0 phar:///opt/php-tools/phpmetrics.phar/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php(208): PhpParser\Lexer->getNextToken()
#1 phar:///opt/php-tools/phpmetrics.phar/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php(158): PhpParser\ParserAbstract->doParse()
#2 phar:///opt/php-tools/phpmetrics.phar/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php(51): PhpParser\ParserAbstract->parse()
#3 phar:///opt/php-tools/phpmetrics.phar/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php(32): PhpParser\Parser\Multiple->tryParse()
#4 phar:///opt/php-tools/phpmetrics.phar/src/Hal/Application/Analyze.php(104): PhpParser\Parser\Multiple->parse()
#5 phar:///opt/php-tools/phpmetrics.phar/src/Hal/Application/Application.php(57): Hal\Application\Analyze->run()
#6 /opt/php-tools/phpmetrics.phar(22): Hal\Application\Application->run()
#7 {main}
  thrown in phar:///opt/php-tools/phpmetrics.phar/vendor/nikic/php-parser/lib/PhpParser/Lexer.php on line 333
@niconoe-
Copy link
Contributor

This was an issue with PhpParser and it should be fixed now.
Could you give it a try on the version 3.0.0-rc4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants