-
-
Notifications
You must be signed in to change notification settings - Fork 737
Closed
rectorphp/rector-src
#6871Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | last dev-main |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/b02bb8b6-ffa4-44d6-ac94-a893250c2ff0
<?php
final class DemoFile
{
public static function isLeapyear(int $year): bool
{
if (($year % 400) == 0 || (($year & 4) == 0 && ($year % 100) != 0)) {
return true;
}
return false;
}
}Responsible rules
SimplifyIfReturnBoolRector
Expected Behavior
Rector should keep the brackets like so:
<?php
final class DemoFile
{
public static function isLeapyear(int $year): bool
{
return (($year % 400) == 0 || (($year & 4) == 0 && ($year % 100) != 0));
}
}instead of dropping them:
<?php
final class DemoFile
{
public static function isLeapyear(int $year): bool
{
return (($year % 400) == 0 || ($year & 4) == 0 && ($year % 100) != 0);
}
}