public function getCallbackCode()
{
$reflection = new \ReflectionFunction($this->_callback);
// Open file and seek to the first line of the closure
$file = new \SplFileObject($reflection->getFileName());
$file->seek($reflection->getStartLine() - 1);
// Retrieve all of the lines that contain code for the closure
$code = '';
while ($file->key() < $reflection->getEndLine()) {
$code .= $file->current();
$file->next();
}
$begin = strpos($code, 'function');
$end = strrpos($code, '}');
$code = substr($code, $begin, $end - $begin + 1);
return $code;
}