Skip to content

[DeadCode] Skip property fetch on cond as may be overridden on RemoveAlwaysTrueIfConditionRector#5796

Merged
samsonasik merged 7 commits intomainfrom
skip-eov
Apr 3, 2024
Merged

[DeadCode] Skip property fetch on cond as may be overridden on RemoveAlwaysTrueIfConditionRector#5796
samsonasik merged 7 commits intomainfrom
skip-eov

Conversation

@samsonasik
Copy link
Copy Markdown
Member

@samsonasik samsonasik commented Apr 3, 2024

@samsonasik
Copy link
Copy Markdown
Member Author

Fixed 🎉 /cc @georgec-floyt

@samsonasik samsonasik changed the title [DeadCode] Skip property fetch overriden by next method call on RemoveAlwaysTrueIfConditionRector [DeadCode] Skip property fetch on cond as may be overridden on RemoveAlwaysTrueIfConditionRector Apr 3, 2024
}

return false;
return $propertyFetches !== [];
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

skip property fetch on if condition seems safer 👍

@samsonasik
Copy link
Copy Markdown
Member Author

@gruberroland this also fix rectorphp/rector#8413 as ArrayDimFetch type is unreliable to be removed, related with phpstan bug phpstan/phpstan#10640

@samsonasik
Copy link
Copy Markdown
Member Author

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

@samsonasik samsonasik merged commit 91ed251 into main Apr 3, 2024
@samsonasik samsonasik deleted the skip-eov branch April 3, 2024 12:11
@ghost
Copy link
Copy Markdown

ghost commented Apr 3, 2024

Thank you @samsonasik!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants