Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Refactoring: Decompose Conditional (before)
if ($date->before(SUMMER_START) || $date->after(SUMMER_END)) {
$charge = $quantity * $this->winter_rate + $this->winter_service_charge;
} else {
$charge = $quantity * $this->summer_rate;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.