Skip to content
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

[CodeQuality] Using local variable $hasChanged on NarrowUnionTypeDocRector #3697

Merged
merged 1 commit into from
Apr 28, 2023

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Apr 28, 2023

Rector rule is shared service, so when using property fetch and assign:

$this->hasChanged = true;

it shared on next call which make return $node instead of return null even no modified on the node. This PR change to use local variable.

Other rules should be used local variable instead as well when possible 👍

@samsonasik
Copy link
Member Author

samsonasik commented Apr 28, 2023

All checks have passed 🎉 @TomasVotruba I think it is ready.

@TomasVotruba TomasVotruba merged commit 14b6073 into main Apr 28, 2023
40 checks passed
@TomasVotruba TomasVotruba deleted the local-var branch April 28, 2023 09:48
@TomasVotruba
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants