src/Exception/CrossException.php
function cpExceptionSource(Exception $e)
    {
        $file = $e->getFile();
        $exception_line = $e->getLine();

        $exception_file_source = array();
        $exception_file_info = new SplFileObject($file);
        foreach ($exception_file_info as $line => $code) {
            $line += 1;
            if ($line <= $exception_line + 6 && $line >= $exception_line - 6) {
                $exception_file_source[$line] = self::highlightCode($code);
            }
        }

        $result['main'] = array(
            'file' => $file,
            'line' => $exception_line,
            'message' => $this->hiddenFileRealPath($e->getMessage()),
            'show_file' => $this->hiddenFileRealPath($file),
            'source' => $exception_file_source,
        );

        $trace = $e->getTrace();
        $this->getTraceInfo($trace, $result['trace']);
        if ($e->getPrevious()) {
            $this->getTraceInfo($e->getPrevious()->getTrace(), $result['previous_trace']);
        }

        return $result;
    }
function cpExceptionSource(Exception $e)
    {
        $file = $e->getFile();
        $exception_line = $e->getLine();

        $exception_file_source = array();
        $exception_file_info = new SplFileObject($file);
        foreach ($exception_file_info as $line => $code) {
            $line += 1;
            if ($line <= $exception_line + 6 && $line >= $exception_line - 6) {
                $exception_file_source[$line] = self::highlightCode($code);
            }
        }

        $result['main'] = array(
            'file' => $file,
            'line' => $exception_line,
            'message' => $this->hiddenFileRealPath($e->getMessage()),
            'show_file' => $this->hiddenFileRealPath($file),
            'source' => $exception_file_source,
        );

        $trace = $e->getTrace();
        $this->getTraceInfo($trace, $result['trace']);
        if ($e->getPrevious()) {
            $this->getTraceInfo($e->getPrevious()->getTrace(), $result['previous_trace']);
        }

        return $result;
    }
根据trace信息分析源码,生成异常处理详细数据

@param Exception $e
@return array