Library to walk AST tree returned by ast extension #4
IvanChepurnyi
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now there is PHPParser that has a set of great tools for walking the syntax tree to detect objects, but it's performance is limited as it uses PHP to parse PHP. However, on most of the systems where PHP-AST is installed, we can use AST extension to utilize internal PHP AST parser, instead of userland one. There is also a polyfill for it based on Microsoft project for VSCode. But this parser does not provide tools to walk a syntax tree to find specific elements we are looking for.
So it means, a tool is required to be written. It should walk a tree of parsed AST and return us objects of interest like dependencies in the class constructor and direct usage of ObjectManager where dependency is hidden.
If someone has any package suggestions that already use extension for AST parsing, feel free to post them in this discussion.
Beta Was this translation helpful? Give feedback.
All reactions