json-rpc-php icon indicating copy to clipboard operation
json-rpc-php copied to clipboard

Using named parameters

Open rvulpescu opened this issue 12 years ago • 0 comments

In JsonRpcServer#183 call_user_func_array expects an array, but when using named parameters $requestObject->params is an object. Other than that, the parameters are correctly reordered via introspection, we just need to cast it to array.

   private function call($methodOwnerService, $requestObject) {
    $callbackFunction = array($methodOwnerService,$requestObject->method);
    return call_user_func_array($callbackFunction, (array) $requestObject->params);
}

rvulpescu avatar Jan 01 '13 15:01 rvulpescu