From 301fe8234fa78feaf14c8ace902785b0bcb7577b Mon Sep 17 00:00:00 2001 From: Sam Leicester Date: Mon, 19 Jul 2021 15:05:24 +0200 Subject: [PATCH] Allow for named arguments via dispatchable trait --- src/Illuminate/Foundation/Bus/Dispatchable.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Illuminate/Foundation/Bus/Dispatchable.php b/src/Illuminate/Foundation/Bus/Dispatchable.php index 210574809e60..3e90e412026d 100644 --- a/src/Illuminate/Foundation/Bus/Dispatchable.php +++ b/src/Illuminate/Foundation/Bus/Dispatchable.php @@ -12,9 +12,9 @@ trait Dispatchable * * @return \Illuminate\Foundation\Bus\PendingDispatch */ - public static function dispatch() + public static function dispatch(...$arguments) { - return new PendingDispatch(new static(...func_get_args())); + return new PendingDispatch(new static(...$arguments)); } /** @@ -52,9 +52,9 @@ public static function dispatchUnless($boolean, ...$arguments) * * @return mixed */ - public static function dispatchSync() + public static function dispatchSync(...$arguments) { - return app(Dispatcher::class)->dispatchSync(new static(...func_get_args())); + return app(Dispatcher::class)->dispatchSync(new static(...$arguments)); } /** @@ -64,9 +64,9 @@ public static function dispatchSync() * * @deprecated Will be removed in a future Laravel version. */ - public static function dispatchNow() + public static function dispatchNow(...$arguments) { - return app(Dispatcher::class)->dispatchNow(new static(...func_get_args())); + return app(Dispatcher::class)->dispatchNow(new static(...$arguments)); } /** @@ -74,9 +74,9 @@ public static function dispatchNow() * * @return mixed */ - public static function dispatchAfterResponse() + public static function dispatchAfterResponse(...$arguments) { - return app(Dispatcher::class)->dispatchAfterResponse(new static(...func_get_args())); + return app(Dispatcher::class)->dispatchAfterResponse(new static(...$arguments)); } /**