Skip to content

Conversation

@TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Oct 3, 2025

No description provided.

@TomasVotruba TomasVotruba changed the title tv identical bool add support for boolean vs constant boolean type Oct 3, 2025
@TomasVotruba TomasVotruba changed the title add support for boolean vs constant boolean type add support for boolean vs constant boolean type in UseIdenticalOverEqualWithSameTypeRector Oct 3, 2025
@TomasVotruba TomasVotruba merged commit 7506334 into main Oct 3, 2025
50 checks passed
@TomasVotruba TomasVotruba deleted the tv-identical-bool branch October 3, 2025 22:13
{
public function equal()
{
if ($this->getValue() === 'hi') {
Copy link
Member

@samsonasik samsonasik Oct 3, 2025

Choose a reason for hiding this comment

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

this cause regression on numeric string "1", see https://3v4l.org/JEeP5

I will create PR to skip numeric string.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I found another regression that it cause invalid result on integer 0 vs false, see https://3v4l.org/Pp8Vr

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I found another regression that it cause invalid result on float vs bool, see https://3v4l.org/I3GQS

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I found a better approach by using TypeComparator so the type are both normalized on equal check.

@TomasVotruba
Copy link
Member Author

👍

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