src/Whoops/Exception/Formatter.php
public static function formatExceptionAsDataArray(Inspector $inspector, $shouldAddTrace)
    {
        $exception = $inspector->getException();
        $response = [
            'type'    => get_class($exception),
            'message' => $exception->getMessage(),
            'file'    => $exception->getFile(),
            'line'    => $exception->getLine(),
        ];

        if ($shouldAddTrace) {
            $frames    = $inspector->getFrames();
            $frameData = [];

            foreach ($frames as $frame) {
                /** @var Frame $frame */
                $frameData[] = [
                    'file'     => $frame->getFile(),
                    'line'     => $frame->getLine(),
                    'function' => $frame->getFunction(),
                    'class'    => $frame->getClass(),
                    'args'     => $frame->getArgs(),
                ];
            }

            $response['trace'] = $frameData;
        }

        return $response;
    }
public static function formatExceptionAsDataArray(Inspector $inspector, $shouldAddTrace)
    {
        $exception = $inspector->getException();
        $response = [
            'type'    => get_class($exception),
            'message' => $exception->getMessage(),
            'file'    => $exception->getFile(),
            'line'    => $exception->getLine(),
        ];

        if ($shouldAddTrace) {
            $frames    = $inspector->getFrames();
            $frameData = [];

            foreach ($frames as $frame) {
                /** @var Frame $frame */
                $frameData[] = [
                    'file'     => $frame->getFile(),
                    'line'     => $frame->getLine(),
                    'function' => $frame->getFunction(),
                    'class'    => $frame->getClass(),
                    'args'     => $frame->getArgs(),
                ];
            }

            $response['trace'] = $frameData;
        }

        return $response;
    }
public static function formatExceptionAsDataArray ( Inspector $ inspector , $ shouldAddTrace ) { $ exception = $ inspector -> getException ( ) ; $ response = [ 'type' => get_class ( $ exception ) , 'message' => $ exception -> getMessage ( ) , 'file' => $ exception -> getFile ( ) , 'line' => $ exception -> getLine ( ) , ] ; if ( $ shouldAddTrace ) { $ frames = $ inspector -> getFrames ( ) ; $ frameData = [ ] ; foreach ( $ frames as $ frame ) { /** @var Frame $frame */ $ frameData [ ] = [ 'file' => $ frame -> getFile ( ) , 'line' => $ frame -> getLine ( ) , 'function' => $ frame -> getFunction ( ) , 'class' => $ frame -> getClass ( ) , 'args' => $ frame -> getArgs ( ) , ] ; } $ response [ 'trace' ] = $ frameData ; } return $ response ; }
Returns all basic information about the exception in a simple array
for further convertion to other languages
@param  Inspector $inspector
@param  bool      $shouldAddTrace
@return array
Returns all basic information about the exception in a simple array for further convertion to other languages