From 397bc3c80fdedfafe2ba53240541179b00271385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 22 Apr 2021 14:22:11 +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/Handler.php | 1 - HttpServer/Route/Node.php | 9 ++++--- System/Aop.php | 47 +++++++++++++++++++----------------- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/HttpServer/Route/Handler.php b/HttpServer/Route/Handler.php index c5ec8e7c..92b73c5b 100644 --- a/HttpServer/Route/Handler.php +++ b/HttpServer/Route/Handler.php @@ -45,7 +45,6 @@ class Handler extends HttpService * @param $route * @param $handler * @return Handler|Node|null - * @throws ConfigException */ public function handler($route, $handler): Handler|Node|null { diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index 935ffaaa..0d60ef6a 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -545,10 +545,11 @@ class Node extends HttpService } - /** - * @return Validator|bool - * @throws Exception - */ + /** + * @param $dispatchParams + * @return mixed + * @throws Exception + */ private function runValidator($dispatchParams): mixed { /** @var HttpFilter $filter */ diff --git a/System/Aop.php b/System/Aop.php index 61827fd3..e40847a6 100644 --- a/System/Aop.php +++ b/System/Aop.php @@ -41,12 +41,14 @@ class Aop extends Component } - /** - * @return mixed - * @throws NotFindClassException - * @throws ReflectionException - * @throws Exception - */ + /** + * @param $handler + * @param $params + * @return mixed + * @throws NotFindClassException + * @throws ReflectionException + * @throws Exception + */ final public function dispatch($handler, $params): mixed { if ($handler instanceof \Closure) { @@ -60,15 +62,16 @@ class Aop extends Component } - /** - * @param $handler - * @param $params - * @param $aopName - * @return mixed - * @throws \ReflectionException - * @throws \Snowflake\Exception\NotFindClassException - */ - private function invoke($handler, $params, $aopName) + /** + * @param $handler + * @param $params + * @param $aopName + * @return mixed + * @throws ReflectionException + * @throws NotFindClassException + * @throws Exception + */ + private function invoke($handler, $params, $aopName): mixed { $reflect = Snowflake::getDi()->getReflect(current($this->_aop[$aopName])); if (!$reflect->isInstantiable() || !$reflect->hasMethod('invoke')) { @@ -80,13 +83,13 @@ class Aop extends Component } - /** - * @param $handler - * @param $params - * @return false|mixed - * @throws \Exception - */ - private function notFound($handler, $params) + /** + * @param $handler + * @param $params + * @return mixed + * @throws Exception + */ + private function notFound($handler, $params): mixed { if (!method_exists($handler[0], $handler[1])) { return response()->close(404);