Jyxo\ErrorHandler::getAllPreviousExceptions PHP Method

getAllPreviousExceptions() private static method

Returns all exception's previous exceptions.
private static getAllPreviousExceptions ( Exception $exception ) : array
$exception Exception Exception to process
return array
    private static function getAllPreviousExceptions(\Exception $exception) : array
    {
        $stack = [];
        $previous = $exception->getPrevious();
        while (null !== $previous) {
            $stack[] = $previous;
            $previous = $previous->getPrevious();
        }
        return $stack;
    }