From 25090533dfd00f9077d79df6150c705b0aa6faf0 Mon Sep 17 00:00:00 2001 From: pandaLIU <563883861@qq.com> Date: Fri, 14 Oct 2022 23:26:47 +0800 Subject: [PATCH] JsonRpc Compatible with hyperf2.2 and hyperf3.0 --- src/Api/JsonRpcHttpApi.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Api/JsonRpcHttpApi.php b/src/Api/JsonRpcHttpApi.php index ca3a97f..a2f4817 100644 --- a/src/Api/JsonRpcHttpApi.php +++ b/src/Api/JsonRpcHttpApi.php @@ -25,10 +25,6 @@ class JsonRpcHttpApi extends AbstractServiceClient implements ApiInterface { - protected string $serviceName = 'dtmserver'; - - protected string $protocol = 'jsonrpc-http'; - protected ConfigInterface $config; protected JsonRpcClientManager $jsonRpcClientManager; @@ -36,7 +32,9 @@ class JsonRpcHttpApi extends AbstractServiceClient implements ApiInterface public function __construct(ContainerInterface $container, DtmPathGenerator $pathGenerator, JsonRpcClientManager $jsonRpcClientManager) { parent::__construct($container); - + // Compatible with hyperf2.2 and hyperf3.0 + $this->serviceName = 'dtmserver'; + $this->protocol = 'jsonrpc-http'; $this->pathGenerator = $pathGenerator; $this->config = $container->get(ConfigInterface::class); $this->jsonRpcClientManager = $jsonRpcClientManager;