Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.
This repository was archived by the owner on May 6, 2025. It is now read-only.

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

@PaddyLock

Description

@PaddyLock

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

Activity

dbrumann

dbrumann commented on Jun 28, 2019

@dbrumann

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

BThiebaut commented on Dec 11, 2019

@BThiebaut

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @PaddyLock@dbrumann@BThiebaut

        Issue actions

          Argument 1 passed to PhpParser\Node\Stmt\StaticVar::__construct() must be an instance of PhpParser\Node\Expr\Variable, string given · Issue #148 · opensoftwareconsulting/deprecation-detector