public static function toArray($e, $getTrace = true, $catcher = null)
    {
        $data = [
            'class' => \get_class($e),
            'message' => $e->getMessage(),
            'code' => $e->getCode(),
            'file' => $e->getFile() . ':' . $e->getLine(),
        ];

        if ($catcher) {
            $data['catcher'] = $catcher;
        }

        if ($getTrace) {
            $data['trace'] = $e->getTrace();
        }

        return $data;
    }
public static function toArray($e, $getTrace = true, $catcher = null)
    {
        $data = [
            'class' => \get_class($e),
            'message' => $e->getMessage(),
            'code' => $e->getCode(),
            'file' => $e->getFile() . ':' . $e->getLine(),
        ];

        if ($catcher) {
            $data['catcher'] = $catcher;
        }

        if ($getTrace) {
            $data['trace'] = $e->getTrace();
        }

        return $data;
    }
public static function toArray ( $ e , $ getTrace = true , $ catcher = null ) { $ data = [ 'class' => \ get_class ( $ e ) , 'message' => $ e -> getMessage ( ) , 'code' => $ e -> getCode ( ) , 'file' => $ e -> getFile ( ) . ':' . $ e -> getLine ( ) , ] ; if ( $ catcher ) { $ data [ 'catcher' ] = $ catcher ; } if ( $ getTrace ) { $ data [ 'trace' ] = $ e -> getTrace ( ) ; } return $ data ; }
Converts an exception into a simple array.
@param \Exception|\Throwable $e the exception being converted
@param bool $getTrace
@param null|string $catcher
@return array
Converts an exception into a simple array .