diff --git a/conf/config.neon b/conf/config.neon index 9e5e1fc626..39da24dbd5 100644 --- a/conf/config.neon +++ b/conf/config.neon @@ -1174,7 +1174,7 @@ services: autowired: no currentPhpVersionParser: - class: PHPStan\Parser\DirectParser + class: PHPStan\Parser\RichParser arguments: parser: @currentPhpVersionPhpParser lexer: @currentPhpVersionLexer diff --git a/src/Parser/DirectParser.php b/src/Parser/RichParser.php similarity index 98% rename from src/Parser/DirectParser.php rename to src/Parser/RichParser.php index 54389920f7..11da86afc9 100644 --- a/src/Parser/DirectParser.php +++ b/src/Parser/RichParser.php @@ -10,7 +10,7 @@ use PHPStan\File\FileReader; use PHPStan\NodeVisitor\StatementOrderVisitor; -class DirectParser implements Parser +class RichParser implements Parser { private \PhpParser\Parser $parser; diff --git a/tests/PHPStan/Analyser/AnalyserTest.php b/tests/PHPStan/Analyser/AnalyserTest.php index 958ea8245a..ba1cc663d8 100644 --- a/tests/PHPStan/Analyser/AnalyserTest.php +++ b/tests/PHPStan/Analyser/AnalyserTest.php @@ -10,8 +10,8 @@ use PHPStan\Dependency\ExportedNodeResolver; use PHPStan\File\RelativePathHelper; use PHPStan\NodeVisitor\StatementOrderVisitor; -use PHPStan\Parser\DirectParser; use PHPStan\Parser\NodeChildrenVisitor; +use PHPStan\Parser\RichParser; use PHPStan\Php\PhpVersion; use PHPStan\PhpDoc\PhpDocInheritanceResolver; use PHPStan\PhpDoc\PhpDocNodeResolver; @@ -521,7 +521,7 @@ private function createAnalyser(bool $reportUnmatchedIgnoredErrors): \PHPStan\An $fileAnalyser = new FileAnalyser( $this->createScopeFactory($broker, $typeSpecifier), $nodeScopeResolver, - new DirectParser( + new RichParser( new \PhpParser\Parser\Php7($lexer), $lexer, new \PhpParser\NodeVisitor\NameResolver(),