Run Rector on your code to see what it can do for you:
<?php final class Repro
public ?string $transaction = null; - public function hasStale(): bool - { - return $this->donation === null - || ($this->commission > 0 && $this->transaction === null) - || $this->somethingElse() - || $this->anotherThing(); + public function hasStale(): bool + { + if ($this->somethingElse()) { + return true; + } + return $this->anotherThing(); } private function somethingElse(): bool
Applied Rules:
Not a change you expect?
rector.php