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

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

Merged
merged 7 commits into from
Apr 3, 2024

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Apr 3, 2024

@samsonasik
Copy link
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
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
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
Member Author

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

@samsonasik samsonasik merged commit 91ed251 into main Apr 3, 2024
41 checks passed
@samsonasik samsonasik deleted the skip-eov branch April 3, 2024 12:11
@georgec-floyt
Copy link

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
3 participants