Skip to content

Instantly share code, notes, and snippets.

@jwage
Created April 15, 2010 20:01
Show Gist options
  • Save jwage/367572 to your computer and use it in GitHub Desktop.
Save jwage/367572 to your computer and use it in GitHub Desktop.
class OutputWriter
{
private $_closure;
public function __construct($closure = null)
{
if ($closure === null) {
$closure = function($message) {};
}
$this->_closure = $closure;
}
public function write($message)
{
$closure = $this->_closure;
$closure($message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment