private function formatThrowableObjects(array $array)
    {
        array_walk_recursive($array, function (&$value) {
            if ($value instanceof \Throwable) {
                try {
                    $value = serialize($value);
                } catch (\Throwable $throwable) {
                    $value = $this->formatThrowable($value);
                }
            }
        });

        return $array;
    }
private function formatThrowableObjects(array $array)
    {
        array_walk_recursive($array, function (&$value) {
            if ($value instanceof \Throwable) {
                try {
                    $value = serialize($value);
                } catch (\Throwable $throwable) {
                    $value = $this->formatThrowable($value);
                }
            }
        });

        return $array;
    }
private function formatThrowableObjects ( array $ array ) { array_walk_recursive ( $ array , function ( & $ value ) { if ( $ value instanceof \ Throwable ) { try { $ value = serialize ( $ value ) ; } catch ( \ Throwable $ throwable ) { $ value = $ this -> formatThrowable ( $ value ) ; } } } ) ; return $ array ; }
Turns any Throwable object present in the given array into a string
representation. If the object cannot be serialized, an approximative
representation of the object is given instead.

@param array $array

@return array
Turns any Throwable object present in the given array into a string representation . If the object cannot be serialized an approximative representation of the object is given instead .