diff --git a/packages/NodeTypeResolver/NodeScopeAndMetadataDecorator.php b/packages/NodeTypeResolver/NodeScopeAndMetadataDecorator.php index d9246a71cd6..d5a8daf1189 100644 --- a/packages/NodeTypeResolver/NodeScopeAndMetadataDecorator.php +++ b/packages/NodeTypeResolver/NodeScopeAndMetadataDecorator.php @@ -40,16 +40,4 @@ public function decorateNodesFromFile(File $file, array $stmts): array return $nodeTraverser->traverse($stmts); } - - /** - * @param Stmt[] $stmts - * @return Stmt[] - */ - public function decorateStmtsFromString(array $stmts): array - { - $nodeTraverser = new NodeTraverser(); - $nodeTraverser->addVisitor($this->nodeConnectingVisitor); - - return $nodeTraverser->traverse($stmts); - } } diff --git a/src/PhpParser/Parser/InlineCodeParser.php b/src/PhpParser/Parser/InlineCodeParser.php index beafa51fb91..83046959759 100644 --- a/src/PhpParser/Parser/InlineCodeParser.php +++ b/src/PhpParser/Parser/InlineCodeParser.php @@ -16,7 +16,6 @@ use Rector\Core\PhpParser\Node\Value\ValueResolver; use Rector\Core\Util\StringUtils; use Rector\NodeTypeResolver\Node\AttributeKey; -use Rector\NodeTypeResolver\NodeScopeAndMetadataDecorator; final class InlineCodeParser { @@ -64,7 +63,6 @@ final class InlineCodeParser public function __construct( private readonly NodePrinterInterface $nodePrinter, - private readonly NodeScopeAndMetadataDecorator $nodeScopeAndMetadataDecorator, private readonly SimplePhpParser $simplePhpParser, private readonly ValueResolver $valueResolver ) { @@ -84,8 +82,7 @@ public function parse(string $content): array $content = StringUtils::isMatch($content, self::OPEN_PHP_TAG_REGEX) ? $content : 'simplePhpParser->parseString($content); - return $this->nodeScopeAndMetadataDecorator->decorateStmtsFromString($stmts); + return $this->simplePhpParser->parseString($content); } public function stringify(Expr $expr): string