mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-30 02:37:58 +08:00
Merge pull request #2077 from sy-records/update-ws-doc
remove typehinting from websocket docs
This commit is contained in:
commit
577f42a8ee
@ -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');
|
||||
}
|
||||
|
@ -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']);
|
||||
}
|
||||
|
@ -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']);
|
||||
}
|
||||
|
@ -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']);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user