From d7950ca32a71a25bfdf17b0781a25fec2654864a Mon Sep 17 00:00:00 2001 From: gzydong <837215079@qq.com> Date: Mon, 9 Aug 2021 22:15:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/Message/ReceiveHandleService.php | 14 +++++--------- app/Service/SocketClientService.php | 2 +- app/Traits/StaticInstance.php | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/Service/Message/ReceiveHandleService.php b/app/Service/Message/ReceiveHandleService.php index 590f879..ac7de0b 100644 --- a/app/Service/Message/ReceiveHandleService.php +++ b/app/Service/Message/ReceiveHandleService.php @@ -3,13 +3,9 @@ declare(strict_types=1); namespace App\Service\Message; -use App\Cache\LastMessage; -use App\Cache\UnreadTalkCache; use App\Constants\TalkEventConstant; -use App\Constants\TalkMessageType; use App\Constants\TalkModeConstant; use App\Event\TalkEvent; -use App\Model\Talk\TalkRecords; use App\Service\SocketClientService; use App\Service\TalkMessageService; use App\Support\UserRelation; @@ -44,8 +40,8 @@ class ReceiveHandleService * 对话文本消息 * * @param Response|Server $server - * @param Frame $frame - * @param array|string $data 解析后数据 + * @param Frame $frame + * @param array|string $data 解析后数据 * @return void */ public function onTalk($server, Frame $frame, $data) @@ -77,9 +73,9 @@ class ReceiveHandleService * 键盘输入消息 * * @param Response|Server $server - * @param Frame $frame - * @param array|string $data 解析后数据 - * @return false + * @param Frame $frame + * @param array|string $data 解析后数据 + * @return void */ public function onKeyboard($server, Frame $frame, $data) { diff --git a/app/Service/SocketClientService.php b/app/Service/SocketClientService.php index 9489ea7..3680806 100644 --- a/app/Service/SocketClientService.php +++ b/app/Service/SocketClientService.php @@ -82,7 +82,7 @@ class SocketClientService * @param string $run_id 服务运行ID(默认当前服务ID) * @return array */ - public function findUserFds(int $user_id, $run_id = SERVER_RUN_ID) + public function findUserFds(int $user_id, $run_id = SERVER_RUN_ID): array { return SocketUserBindFds::getInstance()->findFds($user_id, $run_id); } diff --git a/app/Traits/StaticInstance.php b/app/Traits/StaticInstance.php index c9fd0e3..71fc89b 100644 --- a/app/Traits/StaticInstance.php +++ b/app/Traits/StaticInstance.php @@ -20,7 +20,7 @@ trait StaticInstance * * @return static */ - static public function getInstance() + public static function getInstance() { if (is_null(static::$instance)) { static::$instance = new static();