Skip to content

Conversation

@samsonasik
Copy link
Member

No description provided.

@samsonasik samsonasik enabled auto-merge (squash) December 26, 2024 00:45
@samsonasik samsonasik merged commit 6b0e4f0 into main Dec 26, 2024
6 checks passed
@samsonasik samsonasik deleted the skip-loose-4 branch December 26, 2024 00:46
{
$this->assertNotEquals(1, $float);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

This should be covered a separate rule that would update both name and type.

-$this->assertNotEquals(1, $float);
+$this->assertNotSame(1.0, $float);

Copy link
Member Author

Choose a reason for hiding this comment

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

loose comparison needs to be verified manually, eg int vs float, it can be true while on assertSame it be false, on opposite, it happen as well, make always not same, which actually can be equal

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I see what you mean, that's value need to be changed, however, that's need to be checked as constant value, otherwise, cast (float)/(int) may be needed

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it should be applied on constant int/float values only. I always handle this change manually, often ~100s of cases and it's such a pain :D

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