This commit is contained in:
2020-09-07 02:15:51 +08:00
parent db6497f256
commit 0b3036e082
3 changed files with 74 additions and 2 deletions
+19 -2
View File
@@ -63,15 +63,32 @@ class Middleware
* @param Node $node
* @return array
*/
public function annotation($node)
protected function annotation($node)
{
$middleWares = $this->middleWares;
if (!$node->hasInterceptor()) {
return $middleWares;
return $this->annotation_limit($node, $middleWares);
}
foreach ($node->getInterceptor() as $item) {
$middleWares[] = $item[0];
}
return $this->annotation_limit($node, $middleWares);
}
/**
* @param Node $node
* @param $middleWares
* @return array
*/
protected function annotation_limit($node, $middleWares)
{
if (!$node->hasLimits()) {
return $middleWares;
}
foreach ($node->getLimits() as $item) {
$middleWares[] = $item[0];
}
return $middleWares;
}