diff --git a/Annotation/Route/Middleware.php b/Annotation/Route/Middleware.php index 15412b25..aaa9c767 100644 --- a/Annotation/Route/Middleware.php +++ b/Annotation/Route/Middleware.php @@ -25,14 +25,16 @@ use Snowflake\Snowflake; if (is_string($this->middleware)) { $this->middleware = [$this->middleware]; } + + $array = []; foreach ($this->middleware as $key => $value) { $sn = Snowflake::createObject($value); - if (!($sn instanceof \HttpServer\IInterface\Middleware)) { continue; } - $this->middleware[$key] = [$sn, 'onHandler']; + $array[] = [$sn, 'onHandler']; } + $this->middleware = $array; } diff --git a/HttpServer/Route/Middleware.php b/HttpServer/Route/Middleware.php index a23c40e1..6eab96c2 100644 --- a/HttpServer/Route/Middleware.php +++ b/HttpServer/Route/Middleware.php @@ -76,7 +76,6 @@ class Middleware if (empty($annotation)) { return; } - var_dump($annotation, $action); foreach ($annotation as $name => $_attribute) { foreach ($_attribute as $attribute) { if ($attribute instanceof Interceptor) { diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index 99dc7a8e..c11d18d6 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -405,6 +405,7 @@ class Node extends HttpService $class = [$class]; } foreach ($class as $closure) { + var_dump($closure); if (in_array($closure, $this->middleware)) { continue; }