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

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

Open
PaddyLock opened this issue Jun 26, 2019 · 2 comments

Comments

@PaddyLock
Copy link

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

@dbrumann
Copy link

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.

@BThiebaut
Copy link

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>]

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

No branches or pull requests

3 participants