在一个重构规则的重构函数中,如何将当前节点打印为代码?

huangapple go评论82阅读模式
英文:

In a rector rule's refactor function, how to print the current node as code?

问题

在规则的 refactor 函数中有一个 Node,我如何将整个节点打印为 PHP 代码?

英文:

Having a Node in the refactor function of a rule, how can I print the full node as php code?

答案1

得分: 0

已找到!

使用Composer安装rector/rector-debugging包。

然后可以使用一些辅助工具。

我需要的是print_node

英文:

Found !

Install, using composer, the package rector/rector-debugging

Then there is available some helpers.

The one I needed was print_node.

huangapple
  • 本文由 发表于 2023年2月16日 16:37:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/75469647.html
  • rector
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定