-
-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mutate public to private methods #500
Conversation
|
Sorry, I did this PR at GitHub opening event in Amsterdam and forgot to check back the status. I'll look into the e2e test. |
Please do. I'm here if you need a hand. |
*/ | ||
public function mutate(Node $node) | ||
{ | ||
/* @var ClassMethod $node */ | ||
return new ClassMethod( | ||
yield new ClassMethod( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What improvement adds the yield here instead of the return?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a new feature (not yet released). It allows to return N
mutations from one mutator. Note the second mutation on line 48 below.
Also, this is not the same as return [new ClassMethod(...), new ClassMethod(...)]
. Such code replaces 1 Node
with an array of Node
s, which is completely different behaviour.
Are you going to finish this PR @deleugpn or can we take over it? |
Sorry, you can take it over. I hope to be back at some point. |
This PR:
Fixes #498
This PR adds the ability to mutate from
public
straight toprivate
methods.