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

[CodeQuality] Skip method call on else on TernaryFalseExpressionToIfRector #5373

Merged
merged 6 commits into from
Dec 18, 2023

Conversation

samsonasik
Copy link
Member

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @gehrisandro

@samsonasik
Copy link
Member Author

Ok, it seems cause error on RemoveUnusedVariableDouble

There were 4 failures:

1) Rector\Core\Tests\Issues\RemoveUnusedVariableDouble\RemoveUnusedVariableDoubleTest::test with data set #0
Failed on fixture file "fixture.php.inc"

Applied Rector rules:
 * Rector\DeadCode\Rector\Assign\RemoveDoubleAssignRector
 * Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector

Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
         $user = ['User' => ['name' => 'John']];
         $objects = [1, 2, 3];
         $groups = [];
+        'default';

I will look more.

@samsonasik samsonasik marked this pull request as draft December 18, 2023 10:59
@samsonasik samsonasik marked this pull request as ready for review December 18, 2023 12:27
@samsonasik
Copy link
Member Author

Fixed by use both detect() and detectCallExpr() 👍

@samsonasik
Copy link
Member Author

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

@samsonasik samsonasik merged commit 4283bef into main Dec 18, 2023
41 checks passed
@samsonasik samsonasik deleted the skip-mehtod-call-on-else branch December 18, 2023 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant