Bug Report
the SimplifyIfReturnBoolRector simplifies wrongly: (!return_false() { return true; } return true; } to return return_false();
| Subject |
Details |
| Rector version |
2.5.4 |
Minimal PHP Code Causing Issue
function return_false(): false { return false; }
function test(): bool
{
if (!return_false()) {
return true;
}
return true;
}
https://getrector.com/demo/342716f9-36b2-4a70-8965-39a13802f2cb
Expected Behaviour
return true seems logical, leaving the code as-is would be okay, too.
Bug Report
the SimplifyIfReturnBoolRector simplifies wrongly:
(!return_false() { return true; } return true; }toreturn return_false();Minimal PHP Code Causing Issue
https://getrector.com/demo/342716f9-36b2-4a70-8965-39a13802f2cb
Expected Behaviour
return trueseems logical, leaving the code as-is would be okay, too.