Skip to content

[Experimental] Add refactorWithScope() method to get typed Scope easily and required #2227

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

Merged
merged 4 commits into from
May 4, 2022

Conversation

TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented May 4, 2022

No description provided.

@TomasVotruba TomasVotruba changed the title tv refactor with scope [Experimental] Add refactorWithScope() method to get typed Scope easily and required May 4, 2022
@TomasVotruba TomasVotruba force-pushed the tv-refactor-with-scope branch from c6a0f29 to 78da569 Compare May 4, 2022 12:03
@TomasVotruba TomasVotruba marked this pull request as draft May 4, 2022 12:03
@TomasVotruba TomasVotruba force-pushed the tv-refactor-with-scope branch from ad667ba to 88240e1 Compare May 4, 2022 12:10
Comment on lines +78 to +82
if ($node instanceof Foreach_) {
// decorate value as well
$node->valueVar->setAttribute(AttributeKey::SCOPE, $mutatingScope);
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ondrejmirtes Hi Ondra, btw, we had some weird bug with missing scope. I though it's Rector creating new nodes that do not have it, but in the end it showed the Foreach->var has no Scope. The hotfix is to add it manually here.

Is that on purpose to walk around something or just missing?

@TomasVotruba TomasVotruba marked this pull request as ready for review May 4, 2022 14:36
@TomasVotruba TomasVotruba force-pushed the tv-refactor-with-scope branch 2 times, most recently from 3f48473 to 6b244cd Compare May 4, 2022 14:39
@TomasVotruba TomasVotruba force-pushed the tv-refactor-with-scope branch from aa295ed to d4f535e Compare May 4, 2022 14:41
@TomasVotruba TomasVotruba merged commit 767e769 into main May 4, 2022
@TomasVotruba TomasVotruba deleted the tv-refactor-with-scope branch May 4, 2022 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants