nodeScopeAndMetadataDecorator = $nodeScopeAndMetadataDecorator; $this->fileWithoutNamespaceNodeTraverser = $fileWithoutNamespaceNodeTraverser; $this->rectorParser = $rectorParser; } /** * @api tests only * @return Stmt[] */ public function parseFileInfoToNodesAndDecorate(string $filePath) : array { $stmts = $this->rectorParser->parseFile($filePath); $stmts = $this->fileWithoutNamespaceNodeTraverser->traverse($stmts); $file = new File($filePath, FileSystem::read($filePath)); return $this->nodeScopeAndMetadataDecorator->decorateNodesFromFile($file, $stmts); } }