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

[DeadCode] Remove dead condition above return anyway #4925

Closed
TomasVotruba opened this issue Dec 20, 2020 · 0 comments · Fixed by #5194
Closed

[DeadCode] Remove dead condition above return anyway #4925

TomasVotruba opened this issue Dec 20, 2020 · 0 comments · Fixed by #5194
Labels

Comments

@TomasVotruba
Copy link
Member

-        if ($node instanceof Expr) {
-            return null;
-        }

        return null;
@TomasVotruba TomasVotruba changed the title [DeadCode] Remove return anyway [DeadCode] Remove dead condition above return anyway Dec 20, 2020
TomasVotruba pushed a commit that referenced this issue Jan 15, 2021
* [DeadCode][WIP] Fixes #4925 Add RemoveDeadConditionAboveReturnRector

* apply

* functional

* skip prev not if

* skip prev has elseif

* skip prev has else

* skip prev has multi stmt

* skip prev not return

* skip prev different return

* cs fix

* class name fixture fix

* skip prev empty stmt

* remove prev empty stmt

* add different cond
TomasVotruba added a commit that referenced this issue Sep 30, 2023
rectorphp/rector-src@0c0e5ee AddParamTypeBasedOnPHPUnitDataProviderRector: Enhance existing rule to handle PHPUnit 10+ DataProvider Attribute (#4925)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant