diff --git a/composer.json b/composer.json index 15227f72cff..c368566a81d 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "nikic/php-parser": "^5.4.0", "ocramius/package-versions": "^2.9", "ondram/ci-detector": "^4.2", - "phpstan/phpdoc-parser": "^2.0", + "phpstan/phpdoc-parser": "^2.0.2", "phpstan/phpstan": "^2.1.3", "react/event-loop": "^1.5", "react/promise": "^3.2", diff --git a/preload-split-package.php b/preload-split-package.php index 03dbe323638..f9f3527c37c 100644 --- a/preload-split-package.php +++ b/preload-split-package.php @@ -264,6 +264,7 @@ require_once __DIR__ . '/../../../vendor/phpstan/phpdoc-parser/src/Ast/Node.php'; require_once __DIR__ . '/../../../vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor.php'; require_once __DIR__ . '/../../../vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php'; +require_once __DIR__ . '/../../../vendor/phpstan/phpdoc-parser/src/Ast/Comment.php'; require_once __DIR__ . '/../../../vendor/phpstan/phpdoc-parser/src/Ast/NodeAttributes.php'; require_once __DIR__ . '/../../../vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprNode.php'; require_once __DIR__ . '/../../../vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagValueNode.php'; diff --git a/preload.php b/preload.php index 3895d091c0e..7068cc5b820 100644 --- a/preload.php +++ b/preload.php @@ -264,6 +264,7 @@ require_once __DIR__ . '/vendor/phpstan/phpdoc-parser/src/Ast/Node.php'; require_once __DIR__ . '/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor.php'; require_once __DIR__ . '/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php'; +require_once __DIR__ . '/vendor/phpstan/phpdoc-parser/src/Ast/Comment.php'; require_once __DIR__ . '/vendor/phpstan/phpdoc-parser/src/Ast/NodeAttributes.php'; require_once __DIR__ . '/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprNode.php'; require_once __DIR__ . '/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagValueNode.php'; diff --git a/src/DependencyInjection/LazyContainerFactory.php b/src/DependencyInjection/LazyContainerFactory.php index 8798585127c..ee8d3a8d813 100644 --- a/src/DependencyInjection/LazyContainerFactory.php +++ b/src/DependencyInjection/LazyContainerFactory.php @@ -12,8 +12,6 @@ use PHPStan\Analyser\ScopeFactory; use PHPStan\Parser\Parser; use PHPStan\PhpDoc\TypeNodeResolver; -use PHPStan\PhpDocParser\Parser\ConstExprParser; -use PHPStan\PhpDocParser\Parser\TypeParser; use PHPStan\PhpDocParser\ParserConfig; use PHPStan\Reflection\ReflectionProvider; use Rector\Application\ChangedNodeScopeRefresher; @@ -423,21 +421,6 @@ public function create(): RectorConfig $rectorConfig->singleton(FileProcessor::class); $rectorConfig->singleton(PostFileProcessor::class); - // phpdoc-parser - $rectorConfig->when(TypeParser::class) - ->needs('$usedAttributes') - ->give([ - 'lines' => true, - 'indexes' => true, - ]); - - $rectorConfig->when(ConstExprParser::class) - ->needs('$usedAttributes') - ->give([ - 'lines' => true, - 'indexes' => true, - ]); - $rectorConfig->when(RectorNodeTraverser::class) ->needs('$rectors') ->giveTagged(RectorInterface::class); @@ -682,11 +665,13 @@ static function ( ->needs('$phpDocNodeVisitors') ->giveTagged(BasePhpDocNodeVisitorInterface::class); + // phpdoc-parser $rectorConfig->singleton( ParserConfig::class, static fn (Container $container): ParserConfig => new ParserConfig([ 'lines' => true, 'indexes' => true, + 'comments' => true, ]) );