Skip to content

Instantly share code, notes, and snippets.

@greydnls
Created June 18, 2015 16:14
Show Gist options
  • Save greydnls/29cbaebf3486f58d02d7 to your computer and use it in GitHub Desktop.
Save greydnls/29cbaebf3486f58d02d7 to your computer and use it in GitHub Desktop.
Default Object
public function amazingFunction(CoolObjectInterface $object = new SlightlyColdObject())
{
$this->object = $object;
}
public function notAsAmazingFunction(BlahObjectInterface $object = null)
{
if ($object == null) $this->object = new BoringObject();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment