src/Helper.php
public static function throw_unless($condition, $exception, ...$parameters)
    {
        if (! $condition) {
            throw (\is_string($exception) ? new $exception(...$parameters) : $exception);
        }

        return $condition;
    }
public static function throw_unless($condition, $exception, ...$parameters)
    {
        if (! $condition) {
            throw (\is_string($exception) ? new $exception(...$parameters) : $exception);
        }

        return $condition;
    }
public static function throw_unless ( $ condition , $ exception , ... $ parameters ) { if ( ! $ condition ) { throw ( \ is_string ( $ exception ) ? new $ exception ( ... $ parameters ) : $ exception ) ; } return $ condition ; }
Throw the given exception unless the given condition is true.

@param  mixed  $condition
@param  \Throwable|string  $exception
@param  array  ...$parameters
@return mixed
@throws \Throwable
Throw the given exception unless the given condition is true .