Closed rajyan closed 2 years ago
Created failing test cases for each demo https://github.com/rectorphp/rector-src/pull/1827 https://github.com/rectorphp/rector-src/pull/1828
We depends on PHPStan types here, see https://github.com/rectorphp/rector-src/pull/1828#issuecomment-1048834130
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.org/demo/1ec8f958-96c5-6650-8257-fd28361f8358
Responsible rules
ExplicitBoolCompareRector
Expected Behavior
Want rector to handle return type ignoring PHPDoc (strictly), or skip.
https://github.com/rectorphp/rector/issues/7007 seems related.
Maybe adding a configure like
AddVoidReturnTypeWhereNoReturnRector
for all rules to use PHPDoc or not when handling types is useful. https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md#addvoidreturntypewherenoreturnrector