diff --git a/composer.json b/composer.json index 0754da7..243e536 100644 --- a/composer.json +++ b/composer.json @@ -15,5 +15,9 @@ } }, "require-dev": { + }, + "api-doc-php": { + "type": "vcs", + "url": "git@git.int.haowumc.com:composer/php-rpc-doc.git" } } diff --git a/src/Client.php b/src/Client.php index 29d40d3..f62d2e4 100644 --- a/src/Client.php +++ b/src/Client.php @@ -97,7 +97,7 @@ class Client $headers = [ 'X-Client-App' => $this->config['app'], ]; - app('rpc.logger')->info("client_request",array_merge($this->server_config, $payload)); + app('rpc.logger')->info("client_request", array_merge($this->server_config, $payload)); $resp = $this->http->request('POST', 'rpc/json-rpc-v2.json', [ 'headers' => $headers, 'json' => $payload, @@ -108,7 +108,7 @@ class Client try { $body = \GuzzleHttp\json_decode($resp->getBody(), true); - app('rpc.logger')->info("client_response",$body); + app('rpc.logger')->info("client_response", $body); if (empty($body)) { throw new RpcServerException('http response empty', 500); } @@ -120,7 +120,7 @@ class Client return $body['result']; } catch (\InvalidArgumentException $e) { - app('rpc.logger')->error('client_decode_error',array_merge($this->server_config, $payload)); + app('rpc.logger')->error('client_decode_error', array_merge($this->server_config, $payload)); throw new RpcServerException('json decode error', -32700); } } diff --git a/src/Server/JsonRpcServer.php b/src/Server/JsonRpcServer.php index ebda98d..04983e6 100644 --- a/src/Server/JsonRpcServer.php +++ b/src/Server/JsonRpcServer.php @@ -84,24 +84,24 @@ class JsonRpcServer extends JsonRpcBase * @param string $method 参数名称 * @return array 返回结果 */ - protected function parseMethod($method) - { - $method = explode('.', $method); - - if (count($method) < 2) { - return ['', '']; - } - - $function = array_pop($method); - $class = 'Rpc' . ucwords(array_pop($method)); - - foreach ($method as $one) { - $class = ucwords($one) . '\\' . $class; - } - - $class = "App\Rpc\\$class"; - return [$class, $function]; - } +// protected function parseMethod($method) +// { +// $method = explode('.', $method); +// +// if (count($method) < 2) { +// return ['', '']; +// } +// +// $function = array_pop($method); +// $class = 'Rpc' . ucwords(array_pop($method)); +// +// foreach ($method as $one) { +// $class = ucwords($one) . '\\' . $class; +// } +// +// $class = "App\Rpc\\$class"; +// return [$class, $function]; +// } protected function isEnoughParameter($class, $method, $parameters)