This commit is contained in:
2021-07-12 17:39:09 +08:00
parent a7dfb571eb
commit e8c2bec566
+6 -7
View File
@@ -158,17 +158,16 @@ class Node extends HttpService
{ {
$middleWares = $this->getMiddleWares(); $middleWares = $this->getMiddleWares();
$middleWares = $this->annotation_limit($this, $middleWares); $middleWares = $this->annotation_limit($this, $middleWares);
$middleWares = $this->annotation_interceptor($this, $middleWares); return $this->annotation_interceptor($this, $middleWares);
return $middleWares;
} }
/** /**
* @param Node $node * @param Node $node
* @param $middleWares * @param array $middleWares
* @return array * @return array
*/ */
protected function annotation_interceptor(Node $node, $middleWares = []): array #[Pure] protected function annotation_interceptor(Node $node, array $middleWares = []): array
{ {
if (!$node->hasInterceptor()) { if (!$node->hasInterceptor()) {
return $middleWares; return $middleWares;
@@ -182,10 +181,10 @@ class Node extends HttpService
/** /**
* @param Node $node * @param Node $node
* @param $middleWares * @param array $middleWares
* @return array * @return array
*/ */
protected function annotation_limit(Node $node, $middleWares = []): array #[Pure] protected function annotation_limit(Node $node, array $middleWares = []): array
{ {
if (!$node->hasLimits()) { if (!$node->hasLimits()) {
return $middleWares; return $middleWares;
@@ -268,7 +267,7 @@ class Node extends HttpService
} }
/** /**
* @param $request * @param Request $request
* @return bool * @return bool
*/ */
public function methodAllow(Request $request): bool public function methodAllow(Request $request): bool