is there a list of variables each PhpParse\Node\Expr class has? #9093
Unanswered
prescriptionlifeline
asked this question in
Q&A
Replies: 1 comment
-
There is no parent, due to speed limitations (https://phpstan.org/blog/preprocessing-ast-for-custom-rules) and breaking the node tree flow. This repository might help you to understand expr nodes: https://github.com/rectorphp/php-parser-nodes-docs Also, you can play and try with nodes quickly here https://github.com/rectorphp/php-parser-nodes-docs |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In reviewing the source code for some of the Rector rules I see that classes like MethodCall, NullsafeMethodCall and StaticCall (all in the PhpParse\Node\Expr namespace) have variables (perhaps that only exist because of the
__get()
magic method idk) like->name
and->args
. But what about other PhpParse\Node\Expr classes? What about (for example) Assign? Having to go review a bunch of different rules to figure out which variables each PhpParse\Node\Expr class has is quite a bit more time consuming then just consulting a pre built list.For that matter, is there a
->parent
variable? Like a MethodCall instance could have an Assign instance as its parent. Then you could do$call->parent->whatever
.Beta Was this translation helpful? Give feedback.
All reactions