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

Fatal error - how to debug #83

Closed
andypost opened this issue Jul 28, 2019 · 2 comments
Closed

Fatal error - how to debug #83

andypost opened this issue Jul 28, 2019 · 2 comments
Labels
needs details Further information is requested

Comments

@andypost
Copy link
Contributor

Trying to use drupal-check -ad -vvv web/modules/custom/ but getting fatal
Not clear how to get which line causes it, because I have this issue only in 1 module but phpstorm shown all fine with it
Less verbose tells... but no way to pass --debug

 ------ ------------------------------------------------------------------------------------ 
         Internal error: Call to undefined method PhpParser\Node\Name::isSpecialClassName()  
         Run PHPStan with --debug option and post the stack trace to:                        
         https://github.com/phpstan/phpstan/issues/new

The -vvv tells

Performing deprecation checks
Performing analysis checks
Current working directory: /mnt
Using Drupal root: /mnt/web
Using vendor root: /mnt/vendor
Using autoloader: /mnt/vendor/autoload.php
/mnt/web/modules/custom/custom_stock/custom_stock.module

PHP Fatal error:  Uncaught Error: Call to a member function isSpecialClassName() on string in phar:///usr/local/bin/drupal-check/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php:1004
Stack trace:
#0 phar:///usr/local/bin/drupal-check/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php(1230): PhpParser\ParserAbstract->checkUseUse(Object(PhpParser\Node\Stmt\UseUse), 3)
#1 phar:///usr/local/bin/drupal-check/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php(284): PhpParser\Parser\Php7->PhpParser\Parser\{closure}(3)
#2 phar:///usr/local/bin/drupal-check/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php(158): PhpParser\ParserAbstract->doParse()
#3 phar:///usr/local/bin/drupal-check/vendor/phpstan/phpstan/src/Parser/DirectParser.php(43): PhpParser\ParserAbstract->parse('<?php\n\n/**\n * @...', Object(PhpParser\ErrorHandler\Collecting))
#4 phar:///usr/local/bin/drupal-check/vendor/phpstan/phpstan/src/Parser/DirectParser.php(33): PHPStan\Parser\DirectParser->parseString('<?php\n\n/**\n * @...')
#5 phar:///usr/lo in phar:///usr/local/bin/drupal-check/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php on line 1004

Fatal error: Uncaught Error: Call to a member function isSpecialClassName() on string in phar:///usr/local/bin/drupal-check/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php:1004
Stack trace:
#0 phar:///usr/local/bin/drupal-check/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php(1230): PhpParser\ParserAbstract->checkUseUse(Object(PhpParser\Node\Stmt\UseUse), 3)
#1 phar:///usr/local/bin/drupal-check/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php(284): PhpParser\Parser\Php7->PhpParser\Parser\{closure}(3)
#2 phar:///usr/local/bin/drupal-check/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php(158): PhpParser\ParserAbstract->doParse()
#3 phar:///usr/local/bin/drupal-check/vendor/phpstan/phpstan/src/Parser/DirectParser.php(43): PhpParser\ParserAbstract->parse('<?php\n\n/**\n * @...', Object(PhpParser\ErrorHandler\Collecting))
#4 phar:///usr/local/bin/drupal-check/vendor/phpstan/phpstan/src/Parser/DirectParser.php(33): PHPStan\Parser\DirectParser->parseString('<?php\n\n/**\n * @...')
#5 phar:///usr/lo in phar:///usr/local/bin/drupal-check/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php on line 1004
@mglaman
Copy link
Owner

mglaman commented Jul 29, 2019

See #57

Can you run composer show nikic/php-parser and make sure it's v4?

@mglaman mglaman added the needs details Further information is requested label Jul 29, 2019
@andypost
Copy link
Contributor Author

Thanks a lot! That's v3.1.5

$ composer why nikic/php-parser
psy/psysh  v0.8.17  requires  nikic/php-parser (~1.3|~2.0|~3.0)  
$ composer why psy/psysh
drupal/console  1.7.0   requires  psy/psysh (0.6.* || ~0.8)  
drush/drush     8.1.15  requires  psy/psysh (~0.6)          

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs details Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants