diff --git a/src/Illuminate/Support/helpers.php b/src/Illuminate/Support/helpers.php index 0eb7d1ce0a9e..130e75d763ac 100755 --- a/src/Illuminate/Support/helpers.php +++ b/src/Illuminate/Support/helpers.php @@ -893,13 +893,13 @@ function tap($value, $callback = null) * * @param bool $boolean * @param \Throwable|string $exception - * @param string $message + * @param array ...$parameters * @return void */ - function throw_if($boolean, $exception, $message = '') + function throw_if($boolean, $exception, ...$parameters) { if ($boolean) { - throw (is_string($exception) ? new $exception($message) : $exception); + throw (is_string($exception) ? new $exception(...$parameters) : $exception); } } } @@ -910,13 +910,13 @@ function throw_if($boolean, $exception, $message = '') * * @param bool $boolean * @param \Throwable|string $exception - * @param string $message + * @param array ...$parameters * @return void */ - function throw_unless($boolean, $exception, $message) + function throw_unless($boolean, $exception, ...$parameters) { if (! $boolean) { - throw (is_string($exception) ? new $exception($message) : $exception); + throw (is_string($exception) ? new $exception(...$parameters) : $exception); } } }