diff --git a/function.php b/function.php index 5438d7e4..073fa246 100644 --- a/function.php +++ b/function.php @@ -23,6 +23,7 @@ use Snowflake\Exception\NotFindClassException; use Snowflake\Snowflake; use HttpServer\Http\Context; use Snowflake\Core\ArrayAccess; +use Swoole\WebSocket\Server; if (!function_exists('make')) { @@ -81,6 +82,22 @@ if (!function_exists('annotation')) { } + +if (!function_exists('swoole')) { + + + /** + * @throws Exception + */ + function swoole(): Swoole\Server|Server + { + return Snowflake::getWebSocket(); + } + + +} + + if (!function_exists('recursive_directory')) {