From 210a15f710318d40dc115350afbb116bf7418b77 Mon Sep 17 00:00:00 2001 From: XiangMin Liu <635750556@qq.com> Date: Mon, 27 Jul 2020 23:35:13 +0800 Subject: [PATCH] style(protocol): code poem --- src/Leevel/Protocol/WebsocketServer.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Leevel/Protocol/WebsocketServer.php b/src/Leevel/Protocol/WebsocketServer.php index b16565f8c..ce3bc0e62 100755 --- a/src/Leevel/Protocol/WebsocketServer.php +++ b/src/Leevel/Protocol/WebsocketServer.php @@ -27,7 +27,7 @@ use Swoole\Websocket\Server as SwooleWebsocketServer; /** - * Websocket 服务 + * Websocket 服务. * * @see https://wiki.swoole.com/wiki/page/397.html * @codeCoverageIgnore @@ -158,8 +158,9 @@ public function onMessage(SwooleWebsocketServer $server, SwooleWebsocketFrame $f } /** - * 监听连接关闭事件 - * 每个浏览器连接关闭时执行一次, reload 时连接不会断开, 也就不会触发该事件. + * 监听连接关闭事件. + * + * - 每个浏览器连接关闭时执行一次, reload 时连接不会断开, 也就不会触发该事件. * * @see https://wiki.swoole.com/wiki/page/p-event/onClose.html */ @@ -169,10 +170,11 @@ public function onWebsocketClose(SwooleWebsocketServer $server, int $fd, int $re $this->log($message); /** - * 未连接 - * WEBSOCKET_STATUS_CONNECTION = 1,连接进入等待握手 - * WEBSOCKET_STATUS_HANDSHAKE = 2,正在握手 - * WEBSOCKET_STATUS_FRAME = 3,已握手成功等待浏览器发送数据帧. + * 未连接. + * + * - WEBSOCKET_STATUS_CONNECTION = 1,连接进入等待握手 + * - WEBSOCKET_STATUS_HANDSHAKE = 2,正在握手 + * - WEBSOCKET_STATUS_FRAME = 3,已握手成功等待浏览器发送数据帧. * * @see https://wiki.swoole.com/wiki/page/413.html */ @@ -214,7 +216,7 @@ protected function setPreRequestMatched(Request $request, array $data): void } /** - * 根据 pathInfo 创建 HTTP 请求对象 + * 根据 pathInfo 创建 HTTP 请求对象. */ protected function createRequestWithPathInfo(string $pathInfo, string $type): Request {