diff --git a/src/BetterPhpDocParser/PhpDocParser/BetterPhpDocParser.php b/src/BetterPhpDocParser/PhpDocParser/BetterPhpDocParser.php index d6bed6bbf97..99ed21c9000 100644 --- a/src/BetterPhpDocParser/PhpDocParser/BetterPhpDocParser.php +++ b/src/BetterPhpDocParser/PhpDocParser/BetterPhpDocParser.php @@ -17,6 +17,7 @@ use PHPStan\PhpDocParser\Parser\PhpDocParser; use PHPStan\PhpDocParser\Parser\TokenIterator; use PHPStan\PhpDocParser\Parser\TypeParser; +use PHPStan\PhpDocParser\ParserConfig; use Rector\BetterPhpDocParser\Contract\PhpDocParser\PhpDocNodeDecoratorInterface; use Rector\BetterPhpDocParser\PhpDocInfo\TokenIteratorFactory; use Rector\BetterPhpDocParser\ValueObject\Parser\BetterTokenIterator; @@ -46,6 +47,7 @@ final class BetterPhpDocParser extends PhpDocParser * @param PhpDocNodeDecoratorInterface[] $phpDocNodeDecorators */ public function __construct( + ParserConfig $parserConfig, TypeParser $typeParser, ConstExprParser $constExprParser, private readonly TokenIteratorFactory $tokenIteratorFactory, @@ -53,6 +55,8 @@ public function __construct( private readonly PrivatesAccessor $privatesAccessor, ) { parent::__construct( + // ParserConfig + $parserConfig, // TypeParser $typeParser, // ConstExprParser diff --git a/src/DependencyInjection/LazyContainerFactory.php b/src/DependencyInjection/LazyContainerFactory.php index 102ad321a71..44d2a1b1212 100644 --- a/src/DependencyInjection/LazyContainerFactory.php +++ b/src/DependencyInjection/LazyContainerFactory.php @@ -14,6 +14,7 @@ use PHPStan\PhpDoc\TypeNodeResolver; use PHPStan\PhpDocParser\Parser\ConstExprParser; use PHPStan\PhpDocParser\Parser\TypeParser; +use PHPStan\PhpDocParser\ParserConfig; use PHPStan\Reflection\BetterReflection\SourceLocator\CachingVisitor; use PHPStan\Reflection\ReflectionProvider; use Rector\Application\ChangedNodeScopeRefresher; @@ -671,6 +672,11 @@ static function ( ->needs('$phpDocNodeVisitors') ->giveTagged(BasePhpDocNodeVisitorInterface::class); + $rectorConfig->singleton( + ParserConfig::class, + static fn (Container $container): ParserConfig => new ParserConfig([]) + ); + return $rectorConfig; }