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

Fix logical comparision #265

Merged
merged 2 commits into from
Jan 16, 2025
Merged

Fix logical comparision #265

merged 2 commits into from
Jan 16, 2025

Conversation

iNem0o
Copy link
Contributor

@iNem0o iNem0o commented Jan 16, 2025

Hello

Here is the fix proposed in the DowngradeThrowExprRector logical error issue.

Why

When downgrading a coalesce operator that uses throw, there is a logical error in how the condition is generated. In the current implementation, the exception is thrown when the left-hand side is not null, but it should be thrown when the left-hand side is null.

@samsonasik
Copy link
Member

Please update fixtures under https://github.com/rectorphp/rector-downgrade-php/tree/main/rules-tests/DowngradePhp80/Rector/Expression/DowngradeThrowExprRector/Fixture and fix ci errors

@samsonasik
Copy link
Member

Could you add new fixture for the usecase you have?

@samsonasik
Copy link
Member

Oh, I see the fixture updated 👍

Copy link
Member

@samsonasik samsonasik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's give it a try 👍

@samsonasik samsonasik merged commit 2e0cde6 into rectorphp:main Jan 16, 2025
6 checks passed
@samsonasik
Copy link
Member

Thank you @iNem0o

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.

2 participants