diff --git a/HttpServer/HttpFilter.php b/HttpServer/HttpFilter.php index 9cf6a0cb..2174991a 100644 --- a/HttpServer/HttpFilter.php +++ b/HttpServer/HttpFilter.php @@ -35,7 +35,7 @@ class HttpFilter extends BaseObject /** * @param string $className * @param string $method - * @return bool + * @return bool|Validator * @throws Exception */ public function check(string $className, string $method): bool|Validator diff --git a/HttpServer/Server.php b/HttpServer/Server.php index 99249bcb..c00eb43f 100644 --- a/HttpServer/Server.php +++ b/HttpServer/Server.php @@ -220,7 +220,7 @@ class Server extends HttpService * @throws ConfigException * @throws Exception */ - public function onProcessListener(): mixed + public function onProcessListener(): \Swoole\Server|null|Packet|Receive|Http|Websocket { if (!($this->swoole instanceof \Swoole\Server)) { return $this->swoole; @@ -284,12 +284,13 @@ class Server extends HttpService } - /** - * @param $config - * @return mixed - * @throws Exception - */ - private function create($config): mixed + /** + * @param $config + * @return \Swoole\Server|Packet|Receive|Http|Websocket|null + * @throws ConfigException + * @throws Exception + */ + private function create($config): \Swoole\Server|null|Packet|Receive|Http|Websocket { $settings = Config::get('settings', []); if (!isset($this->server[$config['type']])) { @@ -322,8 +323,6 @@ class Server extends HttpService * @param $config * @param $settings * @return \Swoole\Server|Packet|Receive|Http|Websocket|null - * @throws NotFindClassException - * @throws ReflectionException * @throws Exception */ private function dispatchCreate($config, $settings): \Swoole\Server|Packet|Receive|Http|Websocket|null @@ -341,8 +340,6 @@ class Server extends HttpService /** * @param $config * @return Http|Packet|Receive|Websocket|null - * @throws NotFindClassException - * @throws ReflectionException * @throws Exception */ private function addListener($config): Packet|Websocket|Receive|Http|null @@ -432,10 +429,7 @@ class Server extends HttpService /** * @param $config - * @param $newListener * @return Packet|Websocket|Receive|Http|null - * @throws NotFindClassException - * @throws ReflectionException * @throws Exception */ private function onListenerBind($config): Packet|Websocket|Receive|Http|null @@ -448,11 +442,10 @@ class Server extends HttpService } - /** - * @param $newListener - * @param $config - * @throws Exception - */ + /** + * @param string $type + * @throws Exception + */ private function bindServerEvent($type = self::TCP) { if (in_array($type, [self::PACKAGE, self::TCP])) {