Skip to content

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

Merged
samsonasik merged 2 commits intomainfrom
reduce-enter
Sep 19, 2023
Merged

[Performance][NodeTypeResolver] Remove $mutatingScope->enterCatchType() usage on PHPStanNodeScopeResolver#5045
samsonasik merged 2 commits intomainfrom
reduce-enter

Conversation

@samsonasik
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

3 participants