Skip to content

Call to undefined method PhpParser\Comment\Doc::getEndLine() in FileAnalyser.php #3207

@alexeyinkin

Description

@alexeyinkin
  1. Checkout 0.12.19.

  2. Put this file in the repository root.
    inheritdoc-sample.php.txt

  3. Run
    bin/phpstan analyse -l 8 inheritdoc-sample.php

I get an error:

PHP Fatal error: Uncaught Error: Call to undefined method PhpParser\Comment\Doc::getEndLine() in /home/alexey/work/phpstan-src/src/Analyser/FileAnalyser.php:267 Stack trace: #0 /home/alexey/work/phpstan-src/src/Analyser/FileAnalyser.php(245): PHPStan\Analyser\FileAnalyser->findLineToIgnoreComment(Object(PhpParser\Comment\Doc)) #1 /home/alexey/work/phpstan-src/src/Analyser/FileAnalyser.php(165): PHPStan\Analyser\FileAnalyser->getLinesToIgnore(Object(PHPStan\Node\FileNode)) #2 /home/alexey/work/phpstan-src/src/Analyser/FileAnalyser.php(181): PHPStan\Analyser\FileAnalyser->PHPStan\Analyser\{closure}(Object(PHPStan\Node\FileNode), Object(PHPStan\Analyser\MutatingScope)) #3 /home/alexey/work/phpstan-src/src/PhpDoc/StubValidator.php(96): PHPStan\Analyser\FileAnalyser->analyseFile('/home/alexey/wo...', Array, Object(PHPStan\Rules\Registry), Object(Closure)) #4 /home/alexey/work/phpstan-src/src/Command/AnalyseApplication.php(85): PHPStan\PhpDoc\StubValidator->validate() #5 /home/alexey/work/phpstan-src/src/Command/AnalyseCommand.php( in /home/alexey/work/phpstan-src/src/Analyser/FileAnalyser.php on line 267

Works fine with 0.12.18.

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

    Issue actions