protected function getSourceCode(Exception $exception)
{
// 读取前9行和后9行
$line = $exception->getLine();
$first = $line - 9 > 0 ? $line - 9 : 1;
try {
$contents = file($exception->getFile());
$source = ['first' => $first, 'source' => array_slice($contents, $first - 1, 19)];
} catch (Exception $e) {
$source = [];
}
return $source;
}