Skip to content

Commit

Permalink
Provide *details* argument to callback function
Browse files Browse the repository at this point in the history
If the router supports wildcard registration the registered rpc
may need to use the procedure uri. This is available on the
details argument.
  • Loading branch information
Devon Bagley committed Mar 29, 2018
1 parent e960862 commit 6ea2f76
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Vinelab/Minion/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,15 @@ public function wrapWithProxy($callback, $isFunction = false)

// We will wrap the callback with a Closure so that we can format the kwArgs that we receive
// into our proprietary Dictionary instance to make things safer.
return function ($args, $kwArgs) use ($callback, $isFunction, $provider) {
return function ($args, $kwArgs, $details) use ($callback, $isFunction, $provider) {

if (is_string($callback) && !$isFunction && $provider instanceof Provider) {
$callback = [$provider, $callback];
}

return call_user_func_array($callback, [$args, Dictionary::make($kwArgs)]);
$params = [$args, Dictionary::make($kwArgs), Dictionary::make($details)];

return call_user_func_array($callback, $params);
};
}
}

0 comments on commit 6ea2f76

Please sign in to comment.