优化代码
parent
e298f3f950
commit
d7950ca32a
|
@ -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;
|
||||
|
@ -79,7 +75,7 @@ class ReceiveHandleService
|
|||
* @param Response|Server $server
|
||||
* @param Frame $frame
|
||||
* @param array|string $data 解析后数据
|
||||
* @return false
|
||||
* @return void
|
||||
*/
|
||||
public function onKeyboard($server, Frame $frame, $data)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue