Allow calling call() with any number of arguments

This commit is contained in:
Zach Borboa
2015-02-25 01:13:58 +07:00
parent e28b41998c
commit ab6c11eb13
+5 -2
View File
@@ -117,10 +117,13 @@ class Curl
return $data;
}
public function call($function)
public function call()
{
$args = func_get_args();
$function = array_shift($args);
if (is_callable($function)) {
call_user_func_array($function, array($this));
array_unshift($args, $this);
call_user_func_array($function, $args);
}
}