Merge pull request #2077 from sy-records/update-ws-doc

remove typehinting from websocket docs
This commit is contained in:
黄朝晖 2020-07-10 16:41:43 +08:00 committed by GitHub
commit 577f42a8ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 18 deletions

View File

@ -62,17 +62,17 @@ use Swoole\Websocket\Frame;
class WebSocketController implements OnMessageInterface, OnOpenInterface, OnCloseInterface
{
public function onMessage(Server $server, Frame $frame): void
public function onMessage($server, Frame $frame): void
{
$server->push($frame->fd, 'Recv: ' . $frame->data);
}
public function onClose(Server $server, int $fd, int $reactorId): void
public function onClose($server, int $fd, int $reactorId): void
{
var_dump('closed');
}
public function onOpen(Server $server, Request $request): void
public function onOpen($server, Request $request): void
{
$server->push($request->fd, 'Opened');
}

View File

@ -63,17 +63,17 @@ use Swoole\WebSocket\Server as WebSocketServer;
class WebSocketController implements OnMessageInterface, OnOpenInterface, OnCloseInterface
{
public function onMessage(WebSocketServer $server, Frame $frame): void
public function onMessage($server, Frame $frame): void
{
$server->push($frame->fd, 'Recv: ' . $frame->data);
}
public function onClose(Server $server, int $fd, int $reactorId): void
public function onClose($server, int $fd, int $reactorId): void
{
var_dump('closed');
}
public function onOpen(WebSocketServer $server, Request $request): void
public function onOpen($server, Request $request): void
{
$server->push($request->fd, 'Opened');
}
@ -109,12 +109,12 @@ use Swoole\WebSocket\Server as WebSocketServer;
class WebSocketController implements OnMessageInterface, OnOpenInterface
{
public function onMessage(WebSocketServer $server, Frame $frame): void
public function onMessage($server, Frame $frame): void
{
$server->push($frame->fd, 'Username: ' . Context::get('username'));
}
public function onOpen(WebSocketServer $server, Request $request): void
public function onOpen($server, Request $request): void
{
Context::set('username', $request->cookie['username']);
}

View File

@ -63,17 +63,17 @@ use Swoole\WebSocket\Server as WebSocketServer;
class WebSocketController implements OnMessageInterface, OnOpenInterface, OnCloseInterface
{
public function onMessage(WebSocketServer $server, Frame $frame): void
public function onMessage($server, Frame $frame): void
{
$server->push($frame->fd, 'Recv: ' . $frame->data);
}
public function onClose(Server $server, int $fd, int $reactorId): void
public function onClose($server, int $fd, int $reactorId): void
{
var_dump('closed');
}
public function onOpen(WebSocketServer $server, Request $request): void
public function onOpen($server, Request $request): void
{
$server->push($request->fd, 'Opened');
}
@ -109,12 +109,12 @@ use Swoole\WebSocket\Server as WebSocketServer;
class WebSocketController implements OnMessageInterface, OnOpenInterface
{
public function onMessage(WebSocketServer $server, Frame $frame): void
public function onMessage($server, Frame $frame): void
{
$server->push($frame->fd, 'Username: ' . Context::get('username'));
}
public function onOpen(WebSocketServer $server, Request $request): void
public function onOpen($server, Request $request): void
{
Context::set('username', $request->cookie['username']);
}

View File

@ -63,17 +63,17 @@ use Swoole\WebSocket\Server as WebSocketServer;
class WebSocketController implements OnMessageInterface, OnOpenInterface, OnCloseInterface
{
public function onMessage(WebSocketServer $server, Frame $frame): void
public function onMessage($server, Frame $frame): void
{
$server->push($frame->fd, 'Recv: ' . $frame->data);
}
public function onClose(Server $server, int $fd, int $reactorId): void
public function onClose($server, int $fd, int $reactorId): void
{
var_dump('closed');
}
public function onOpen(WebSocketServer $server, Request $request): void
public function onOpen($server, Request $request): void
{
$server->push($request->fd, 'Opened');
}
@ -109,12 +109,12 @@ use Swoole\WebSocket\Server as WebSocketServer;
class WebSocketController implements OnMessageInterface, OnOpenInterface
{
public function onMessage(WebSocketServer $server, Frame $frame): void
public function onMessage($server, Frame $frame): void
{
$server->push($frame->fd, 'Username: ' . Context::get('username'));
}
public function onOpen(WebSocketServer $server, Request $request): void
public function onOpen($server, Request $request): void
{
Context::set('username', $request->cookie['username']);
}