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

[Performance][NodeTypeResolver] Remove $mutatingScope->enterCatchType() usage on PHPStanNodeScopeResolver #5045

Merged
merged 2 commits into from
Sep 19, 2023

Conversation

samsonasik
Copy link
Member

@staabm if I remember correctly, $mutatingScope->enterCatchType() on try catch was used on detecting undefined variable which the rule is removed at PR:

I think it save to be removed to reduce memory usage. I will check if this compatible with different projects after this merged.

Copy link
Contributor

@staabm staabm left a comment

Choose a reason for hiding this comment

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

looks cool (as long as build keeps green)

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it to have faster feedback to test :)

@samsonasik samsonasik merged commit 5d27404 into main Sep 19, 2023
@samsonasik samsonasik deleted the reduce-enter branch September 19, 2023 08:41
@samsonasik
Copy link
Member Author

@staabm it seems it cause error on downgrade:


                                                                                
 [ERROR] Could not process                                                      
         "/home/runner/work/rector-src/rector-src/rector-build/vendor/react/even
         t-loop/src/StreamSelectLoop.php" file, due to:                         
         "System error: "Scope not available on "PhpParser\Node\Stmt\Expression"
         node, but is required by a refactorWithScope() method of               
         "Rector\DowngradePhp80\Rector\Expression\DowngradeMatchToSwitchRector" 
         rule. Fix scope refresh on changed nodes first"                        
         Run Rector with "--debug" option and post the report here: 
/~https://github.com/rectorphp/rector/issues/new
". On line:
         45                                                                     
                                                                                

I will revert.

@samsonasik
Copy link
Member Author

Reverting at #5046

samsonasik added a commit that referenced this pull request Sep 19, 2023
…atchType() usage on PHPStanNodeScopeResolver (#5045)" (#5046)

This reverts commit 5d27404.
@staabm
Copy link
Contributor

staabm commented Sep 19, 2023

we should really have this downgrade job here on the repo :-/

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.

3 participants