Skip to content

Instantly share code, notes, and snippets.

@GRMule
Created September 4, 2014 21:17
Show Gist options
  • Save GRMule/5fcccb6c0f494f430317 to your computer and use it in GitHub Desktop.
Save GRMule/5fcccb6c0f494f430317 to your computer and use it in GitHub Desktop.
class MathIsFun {
private $someInterface = null;
public function __construct(iSomeInterface $dependency) {
$this->someInterface = $dependency;
}
public function add($number=0) {
return $number + $this->someInterface->getNumber();
}
}
// vs
class MathIsFun {
public function add(iSomeInterface $dependency, $number=0) {
return $number + $dependency->getNumber();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment