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

[Php52][Php70] Handle ContinueToBreakInSwitchRector + BreakNotInLoopOrSwitchToReturnRector #5217

Merged
merged 7 commits into from
Oct 31, 2023

Conversation

samsonasik
Copy link
Member

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @gabriel-255

@samsonasik
Copy link
Member Author

It seems cause error in rector-downgrade-php:

There were 5 failures:

1) Rector\Tests\DowngradePhp80\Rector\Expression\DowngradeMatchToSwitchRector\DowngradeMatchToSwitchRectorTest::test with data set #7
Failed on fixture file "in_arrow_function.php.inc"
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
 
         $mapped = array_map(
             static function (mixed $default) : mixed {
-                switch (true) {
-                    case is_string($default):
-                        return sprintf('"%s"', $default);
-                    default:
-                        return $default;
-                }
+                return match (true) {
+                    is_string($default) => sprintf('"%s"', $default),
+                    default => $default,
+                };
             }, $defaults

I will check more.

@samsonasik
Copy link
Member Author

should be fixed now 👍

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit 0d55d15 into main Oct 31, 2023
41 checks passed
@samsonasik samsonasik deleted the continue-to-break branch October 31, 2023 12:47
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.

Incorrect behavior of ContinueToBreakInSwitchRector, BreakNotInLoopOrSwitchToReturnRector
1 participant