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

[Php56] Skip multiple catch with same variable on AddDefaultValueForUndefinedVariableRector #2533

Merged
merged 12 commits into from
Jun 20, 2022

Conversation

samsonasik
Copy link
Member

Given the following code:

class SkipMultipleCatchWithUseSameVariable
{
    public function run()
    {
        try {
        } catch (\Exception $e) {
            var_dump($e);
        } catch (\Throwable $e) {
            var_dump($e);
        }
    }
}

It cause result:

     public function run()
     {
+        $e = null;

which should be skipped.

@samsonasik samsonasik requested a review from TomasVotruba as a code owner June 19, 2022 09:12
@samsonasik
Copy link
Member Author

Fixed 🎉

@samsonasik samsonasik marked this pull request as draft June 19, 2022 09:22
@samsonasik
Copy link
Member Author

add more failing test case to check

@samsonasik samsonasik marked this pull request as ready for review June 19, 2022 11:20
@samsonasik
Copy link
Member Author

Fixed 🎉

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@samsonasik samsonasik force-pushed the skip-multiple-catch branch from e7afcb6 to d9a7f30 Compare June 20, 2022 00:01
@samsonasik
Copy link
Member Author

rebased.

@TomasVotruba TomasVotruba merged commit 4eeadae into main Jun 20, 2022
@TomasVotruba TomasVotruba deleted the skip-multiple-catch branch June 20, 2022 07:03
@TomasVotruba
Copy link
Member

Thank you

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