This commit is contained in:
2020-12-16 16:49:02 +08:00
parent ebacc1b65b
commit f0fabf3cf2
2 changed files with 10 additions and 3 deletions
+1 -2
View File
@@ -86,7 +86,6 @@ class Middleware
$node->addAfter($attribute->after);
}
if ($attribute instanceof RMiddleware) {
var_dump($attribute->middleware);
$node->addMiddleware($attribute->middleware);
}
if ($attribute instanceof Limits) {
@@ -105,7 +104,7 @@ class Middleware
{
$middleWares = $this->annotation_limit($node);
$middleWares = $this->annotation_interceptor($node, $middleWares);
foreach ($this->middleWares as $middleWare) {
foreach ($node->getMiddleWares() as $middleWare) {
$middleWares[] = $middleWare;
}
$this->middleWares = [];
+9 -1
View File
@@ -408,6 +408,15 @@ class Node extends Application
}
/**
* @return array
*/
public function getMiddleWares(): array
{
return $this->middleware;
}
/**
* @throws Exception
*/
@@ -418,7 +427,6 @@ class Node extends Application
}
/** @var Middleware $made */
$made = Snowflake::createObject(Middleware::class);
$made->setMiddleWares($this->middleware);
$made->getGenerate($this);
return $this;
}