private function closureParse($closure) { $ref = new \ReflectionFunction($closure); $file = $ref->getFileName(); $start = $ref->getStartLine(); $end = $ref->getEndLine(); $code = File::readLines($file, $start, $end); $infos = Utils::cut('function(', '});', $code); $code = 'function(' . str_replace(["\n", "\r", "\t"], '', $infos) . '}'; return $code; }