变更
This commit is contained in:
@@ -3,20 +3,15 @@
|
||||
namespace Kiri\Websocket\Contract;
|
||||
|
||||
|
||||
use Swoole\WebSocket\Frame;
|
||||
use Swoole\WebSocket\Server;
|
||||
use Swoole\Coroutine\Http\Server as CoroutineServer;
|
||||
|
||||
interface OnCloseInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @param Server|CoroutineServer $server
|
||||
* @param int $fd
|
||||
* @return void
|
||||
*/
|
||||
public function onClose(Server|CoroutineServer $server, int $fd): void;
|
||||
public function OnClose(int $fd): void;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Kiri\Websocket\Contract;
|
||||
|
||||
interface OnDisconnectInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @param int $fd
|
||||
*/
|
||||
public function OnDisconnect(int $fd): void;
|
||||
|
||||
|
||||
}
|
||||
@@ -13,9 +13,9 @@ interface OnHandshakeInterface
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param Response $response
|
||||
* @return int
|
||||
* @return void
|
||||
*/
|
||||
public function onHandshake(Request $request, Response $response): int;
|
||||
public function OnHandshake(Request $request, Response $response): void;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,19 +4,16 @@ namespace Kiri\Websocket\Contract;
|
||||
|
||||
|
||||
use Swoole\WebSocket\Frame;
|
||||
use Swoole\WebSocket\Server;
|
||||
use Swoole\Coroutine\Http\Server as CoroutineServer;
|
||||
|
||||
interface OnMessageInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @param Server|CoroutineServer $server
|
||||
* @param Frame $frame
|
||||
* @return void
|
||||
*/
|
||||
public function onMessage(Server|CoroutineServer $server, Frame $frame): void;
|
||||
public function OnMessage(Frame $frame): void;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,20 +4,16 @@ namespace Kiri\Websocket\Contract;
|
||||
|
||||
|
||||
use Swoole\Http\Request;
|
||||
use Swoole\WebSocket\Frame;
|
||||
use Swoole\WebSocket\Server;
|
||||
use Swoole\Coroutine\Http\Server as CoroutineServer;
|
||||
|
||||
interface OnOpenInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @param Server|CoroutineServer $server
|
||||
* @param Request $request
|
||||
* @return void
|
||||
*/
|
||||
public function onOpen(Server|CoroutineServer $server, Request $request): void;
|
||||
public function onOpen(Request $request): void;
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user