From 07e3f3f1e3d3fc65ed0a30840790e262319b427d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 4 Aug 2021 14:45:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Annotation/Port.php | 45 ------------------------------------- HttpServer/Route/Router.php | 23 ------------------- 2 files changed, 68 deletions(-) delete mode 100644 Annotation/Port.php diff --git a/Annotation/Port.php b/Annotation/Port.php deleted file mode 100644 index 7d239b87..00000000 --- a/Annotation/Port.php +++ /dev/null @@ -1,45 +0,0 @@ -getRouter(); - if (!($class instanceof Porters)) { - return true; - } - $router->addPortListen($this->port, [$class, 'process']); - return true; - } - -} diff --git a/HttpServer/Route/Router.php b/HttpServer/Route/Router.php index 98584c57..e99367d7 100644 --- a/HttpServer/Route/Router.php +++ b/HttpServer/Route/Router.php @@ -82,29 +82,6 @@ class Router extends HttpService implements RouterInterface } - /** - * @param $port - * @param Closure|array|string $closure - * @param null $method - * @return Node|bool|null - * @throws - */ - public function addPortListen($port, Closure|array|string $closure, $method = null): Node|null|bool - { - if (!is_string($closure)) { - return $this->addRoute('add-port-listen/port_' . $port, $closure, 'listen'); - } - if (empty($method)) { - return $this->addError($closure . '::' . $method); - } - $_closure = Snowflake::createObject($closure); - if (!method_exists($_closure, $method)) { - return $this->addError($closure . '::' . $method); - } - return $this->addRoute('add-port-listen/port_' . $port, [$_closure, $method], 'listen'); - } - - /** * @param $path * @param $handler