From 357093fa45f7161bdc3cfeca67ec7f52c632ee1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 15 Dec 2020 17:12:21 +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/Route/Socket.php | 2 -- HttpServer/Route/Node.php | 5 +++-- HttpServer/Server.php | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Annotation/Route/Socket.php b/Annotation/Route/Socket.php index e5ea033a..834d6ced 100644 --- a/Annotation/Route/Socket.php +++ b/Annotation/Route/Socket.php @@ -63,8 +63,6 @@ use Snowflake\Snowflake; $method = $this->event . '::' . (is_null($this->uri) ? 'event' : $this->uri); - var_dump($method); - $node = $router->addRoute($method, $handler, 'sw::socket'); return $this->add($node); diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index a1bd7ed5..57e27879 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -58,17 +58,18 @@ class Node extends Application * @return Node * @throws */ - public function bindHandler($handler) + public function bindHandler($handler): static { if ($handler instanceof Closure) { $this->handler = $handler; - } else if (is_string($handler) && strpos($handler, '@') !== false) { + } else if (is_string($handler) && str_contains($handler, '@')) { list($controller, $action) = explode('@', $handler); if (!empty($this->namespace)) { $controller = implode('\\', $this->namespace) . '\\' . $controller; } $this->handler = $this->getReflect($controller, $action); } else if ($handler != null && !is_callable($handler, true)) { + var_dump($handler); $this->_error = 'Controller is con\'t exec.'; } else { $this->handler = $handler; diff --git a/HttpServer/Server.php b/HttpServer/Server.php index fb8acb75..c10fbb17 100644 --- a/HttpServer/Server.php +++ b/HttpServer/Server.php @@ -471,7 +471,6 @@ class Server extends Application return; } foreach ($aliases as $alias) { - var_dump($alias); $handler = $alias['handler']; foreach ($alias['attributes'] as $key => $attribute) { if ($attribute instanceof IAnnotation) {