Skip to content

[Php55][NodeTypeResolver] Handle crash on dynamic variable concat assign on StringClassNameToClassConstantRector#4283

Merged
samsonasik merged 11 commits intomainfrom
process-dynamic-
Jun 19, 2023
Merged

[Php55][NodeTypeResolver] Handle crash on dynamic variable concat assign on StringClassNameToClassConstantRector#4283
samsonasik merged 11 commits intomainfrom
process-dynamic-

Conversation

@samsonasik
Copy link
Copy Markdown
Member

@samsonasik samsonasik requested a review from TomasVotruba as a code owner June 19, 2023 13:16
@samsonasik
Copy link
Copy Markdown
Member Author

Fixed 🎉 /cc @jakobbuis

@samsonasik samsonasik changed the title [Php55][NodeTypeResolver] Handle crash on dynamci variable concat assign on StringClassNameToClassConstantRector [Php55][NodeTypeResolver] Handle crash on dynamic variable concat assign on StringClassNameToClassConstantRector Jun 19, 2023
@samsonasik
Copy link
Copy Markdown
Member Author

@TomasVotruba I think we need fallback on ScopeAnalyzer->resolveScope()

public function resolveScope(

as this is going to be out of control, we can remove the PARENT_NODE there as well, by check if no scope, then direct fallback to

$this->scopeFactory->createFromFile($filePath)

what do you think?

@samsonasik
Copy link
Copy Markdown
Member Author

@TomasVotruba I think the better solution is to not use Scope on StringClassNameToClassConstantRector, since it can be in any position.

@samsonasik
Copy link
Copy Markdown
Member Author

@TomasVotruba it works 🎉 , no need scope when not needed ;)

@samsonasik
Copy link
Copy Markdown
Member Author

All checks have passed 🎉 @TomasVotruba let's merge it ;)

@samsonasik samsonasik enabled auto-merge (squash) June 19, 2023 14:13
@samsonasik samsonasik merged commit 4b05faa into main Jun 19, 2023
@samsonasik samsonasik deleted the process-dynamic- branch June 19, 2023 14:13
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.

Scope not available error on dynamic variable instantiation

2 participants