diff --git a/src/framework/src/Timer.php b/src/framework/src/Timer.php index 4043c6ae7..64740e102 100644 --- a/src/framework/src/Timer.php +++ b/src/framework/src/Timer.php @@ -22,7 +22,6 @@ class Timer * @param array ...$params * * @return int - * @throws Exception\SwoftException */ public static function tick(int $msec, $callback, ...$params): int { @@ -53,7 +52,6 @@ public static function tick(int $msec, $callback, ...$params): int * @param array ...$params * * @return int - * @throws Exception\SwoftException */ public static function after(int $msec, $callback, ...$params): int { @@ -124,7 +122,6 @@ public static function stats(): array /** * @return array - * @throws Exception\SwoftException */ private static function getLogItems(): array { @@ -141,7 +138,6 @@ private static function getLogItems(): array /** * @param array $items * - * @throws Exception\SwoftException */ private static function initItems(array $items): void { diff --git a/src/rpc-client/src/Connection.php b/src/rpc-client/src/Connection.php index 1880c56fc..f1f66711a 100644 --- a/src/rpc-client/src/Connection.php +++ b/src/rpc-client/src/Connection.php @@ -143,11 +143,17 @@ public function recv() private function getHostPort(): array { $provider = $this->client->getProvider(); - $list = $provider->getList($this->client); - if (empty($provider) || !$provider instanceof ProviderInterface || empty($list)) { + if (empty($provider) || !$provider instanceof ProviderInterface) { return [$this->client->getHost(), $this->client->getPort()]; } + $list = $provider->getList($this->client); + if (empty($list)) { + throw new RpcClientException( + sprintf('Provider return list can not empty!') + ); + } + if (!is_array($list)) { throw new RpcClientException( sprintf('Provider(%s) return format is error!', JsonHelper::encode($list))