deprecation-detector icon indicating copy to clipboard operation
deprecation-detector copied to clipboard

Argument 1 passed to PhpParser\Node\Stmt\StaticVar::__construct() must be an instance of PhpParser\Node\Expr\Variable, string given

Open PaddyLock opened this issue 6 years ago • 2 comments
trafficstars

when I run check I get the following error

[Symfony\Component\Debug\Exception\FatalThrowableError] Argument 1 passed to PhpParser\Node\Stmt\StaticVar::__construct() must be an instance of PhpParser\Node\Expr\Variable, string given, called in /Users /patricklock/Sites/deprecation-detector/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php on line 1854

PaddyLock avatar Jun 26 '19 08:06 PaddyLock

Could you add the full stack trace (you can run the command with additional -vvv option to get the full error output), the code which you were checking and the command you were executing (which arguments)? Right now it's really hard to see how this error was triggered.

dbrumann avatar Jun 28 '19 13:06 dbrumann

Hello, same problem here using php-cli 7.2, I hope it help

  [Symfony\Component\Debug\Exception\FatalThrowableError]                                                                                                                                   
  Argument 1 passed to PhpParser\Node\Stmt\StaticVar::__construct() must be an instance of PhpParser\Node\Expr\Variable, string given, called in phar:///usr/local/bin/deprecation-detecto  
  r/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php on line 1854                                                                                                                      
                                                                                                                                                                                            

Exception trace:
 () at /home/user/workspace/project/site/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php:22
 PhpParser\Node\Stmt\StaticVar->__construct() at phar:///usr/local/bin/deprecation-detector/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php:1854
 PhpParser\Parser\Php7->reduceRule259() at phar:///usr/local/bin/deprecation-detector/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php:262
 PhpParser\ParserAbstract->parse() at phar:///usr/local/bin/deprecation-detector/src/Parser/UsageParser.php:69
 SensioLabs\DeprecationDetector\Parser\UsageParser->parseFile() at phar:///usr/local/bin/deprecation-detector/src/TypeGuessing/AncestorResolver.php:187
 SensioLabs\DeprecationDetector\TypeGuessing\AncestorResolver->findDefinitionFileByComposer() at phar:///usr/local/bin/deprecation-detector/src/TypeGuessing/AncestorResolver.php:147
 SensioLabs\DeprecationDetector\TypeGuessing\AncestorResolver->getDefinitionFile() at phar:///usr/local/bin/deprecation-detector/src/TypeGuessing/AncestorResolver.php:115
 SensioLabs\DeprecationDetector\TypeGuessing\AncestorResolver->resolveClassAncestors() at phar:///usr/local/bin/deprecation-detector/src/TypeGuessing/AncestorResolver.php:78
 SensioLabs\DeprecationDetector\TypeGuessing\AncestorResolver->getClassAncestors() at phar:///usr/local/bin/deprecation-detector/src/Violation/ViolationChecker/MethodViolationChecker.php:44
 SensioLabs\DeprecationDetector\Violation\ViolationChecker\MethodViolationChecker->check() at phar:///usr/local/bin/deprecation-detector/src/Violation/ViolationChecker/ComposedViolationChecker.php:30
 SensioLabs\DeprecationDetector\Violation\ViolationChecker\ComposedViolationChecker->SensioLabs\DeprecationDetector\Violation\ViolationChecker\{closure}() at n/a:n/a
 array_map() at phar:///usr/local/bin/deprecation-detector/src/Violation/ViolationChecker/ComposedViolationChecker.php:35
 SensioLabs\DeprecationDetector\Violation\ViolationChecker\ComposedViolationChecker->check() at phar:///usr/local/bin/deprecation-detector/src/Violation/ViolationDetector.php:45
 SensioLabs\DeprecationDetector\Violation\ViolationDetector->getViolations() at phar:///usr/local/bin/deprecation-detector/src/DeprecationDetector.php:100
 SensioLabs\DeprecationDetector\DeprecationDetector->checkForDeprecations() at phar:///usr/local/bin/deprecation-detector/src/Console/Command/CheckCommand.php:123
 SensioLabs\DeprecationDetector\Console\Command\CheckCommand->execute() at phar:///usr/local/bin/deprecation-detector/vendor/symfony/console/Command/Command.php:262
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/deprecation-detector/vendor/symfony/console/Application.php:826
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/deprecation-detector/vendor/symfony/console/Application.php:190
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/deprecation-detector/vendor/symfony/console/Application.php:121
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/deprecation-detector/bin/deprecation-detector:17
 require() at /usr/local/bin/deprecation-detector:10

check [--container-cache CONTAINER-CACHE] [--no-cache] [--cache-dir CACHE-DIR] [--log-html LOG-HTML] [--output OUTPUT] [--filter-methods [FILTER-METHODS]] [--fail] [--] [<source>] [<ruleset>]

BThiebaut avatar Dec 11 '19 08:12 BThiebaut