From ff067cebd8a009b4b343e670a6d2345fc7c47ac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 15 Dec 2020 19:17:42 +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 --- HttpServer/Route/Node.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index 4e88c08f..3145afcb 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -9,14 +9,14 @@ use Closure; use HttpServer\Http\Request; use Exception; use HttpServer\Application; -use HttpServer\Route\Annotation\Http; use JetBrains\PhpStorm\Pure; use ReflectionException; use Snowflake\Core\JSON; -use Snowflake\Event; use Snowflake\Exception\NotFindClassException; use Snowflake\Snowflake; use Swoole\Coroutine; +use Throwable; +use function Input; /** * Class Node @@ -97,8 +97,8 @@ class Node extends Application /** - * @param $response - * @return mixed|null + * @param null $response + * @return mixed */ public function afterDispatch($response = null): mixed { @@ -188,7 +188,7 @@ class Node extends Application $object = Snowflake::createObject($rule); if (!$object->handler()) { return false; - }; + } } return true; } @@ -210,7 +210,7 @@ class Node extends Application throw new Exception('method ' . $action . ' not exists at ' . $controller . '.'); } return [$reflect->newInstance(), $action]; - } catch (\Throwable $exception) { + } catch (Throwable $exception) { $this->_error = $exception->getMessage(); $this->error($exception->getMessage(), 'router'); return null; @@ -329,7 +329,7 @@ class Node extends Application $_searchMatch = '/<(\w+)?:(.+)?>/'; foreach ($this->childes as $key => $val) { if (preg_match($_searchMatch, $key, $match)) { - \Input()->addGetParam($match[1] ?? '--', $search); + Input()->addGetParam($match[1] ?? '--', $search); return $this->childes[$key]; } }