juno (owner)

Revisions

  • 2773d6 juno Thu Feb 12 23:55:32 -0800 2009
gist: 63781 Download_button fork
public
Description:
Refactoring: Decompose Conditional (before)
Public Clone URL: git://gist.github.com/63781.git
Embed All Files: show embed
decompose_conditional_before.php #
1
2
3
4
5
if ($date->before(SUMMER_START) || $date->after(SUMMER_END)) {
$charge = $quantity * $this->winter_rate + $this->winter_service_charge;
} else {
$charge = $quantity * $this->summer_rate;
}