Skip to content

Instantly share code, notes, and snippets.

@felixgirault
Last active September 26, 2016 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felixgirault/f15f432fffad944b61aa to your computer and use it in GitHub Desktop.
Save felixgirault/f15f432fffad944b61aa to your computer and use it in GitHub Desktop.
Refactoring 2
<?php
function doSomething() {
// 10 LOC
}
function doSomethingElse() {
// 20 LOC
}
doSomethingElse();
<?php
function doSomething($condition = true) {
if ($condition) {
// 10 LOC
} else {
// 20 LOC
}
}
doSomething(false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment