Skip to content

Commit

Permalink
Merge pull request #19 from NeoVance/details-in-callback-arguments
Browse files Browse the repository at this point in the history
Provide *details* argument to callback function
  • Loading branch information
Mulkave authored Apr 3, 2018
2 parents ee574bb + 6ea2f76 commit 21d3d4e
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 @@ -246,13 +246,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 21d3d4e

Please sign in to comment.