src/Exceptions/Inspector.php
private function linearize(Throwable $e): array
    {
        $previous = $e->getPrevious();

        if (is_null($previous)) return [$e];

        return array_merge($this->linearize($previous), [$e]);
    }
private function linearize(Throwable $e): array
    {
        $previous = $e->getPrevious();

        if (is_null($previous)) return [$e];

        return array_merge($this->linearize($previous), [$e]);
    }
private function linearize ( Throwable $ e ) : array { $ previous = $ e -> getPrevious ( ) ; if ( is_null ( $ previous ) ) return [ $ e ] ; return array_merge ( $ this -> linearize ( $ previous ) , [ $ e ] ) ; }
Return an array containing the given exception and all its previous
exceptions.

@param \Throwable $e
@return array
Return an array containing the given exception and all its previous exceptions .