mirror of
https://github.com/danog/amp.git
synced 2024-11-30 04:29:08 +01:00
Fix missing parameter if coroutine invoked without args
This commit is contained in:
parent
6c440b2797
commit
0c4f04c6ab
@ -471,8 +471,8 @@ function wait(Promise $promise, Reactor $reactor = null) {
|
||||
* @return callable Returns the wrapped callable
|
||||
*/
|
||||
function coroutine(callable $func, Reactor $reactor = null, callable $promisifier = null) {
|
||||
return function($data) use ($func, $reactor, $promisifier) {
|
||||
$result = $func($data);
|
||||
return function() use ($func, $reactor, $promisifier) {
|
||||
$result = \call_user_func_array($func, func_get_args());
|
||||
return ($result instanceof \Generator)
|
||||
? resolve($result, $reactor, $promisifier)
|
||||
: $result;
|
||||
|
Loading…
Reference in New Issue
Block a user