改名
This commit is contained in:
@@ -82,6 +82,9 @@ class Annotation extends \Snowflake\Annotation\Annotation
|
||||
case 'Middleware':
|
||||
$this->bindMiddleware($node, $annotation);
|
||||
break;
|
||||
case 'Limits':
|
||||
$this->bindLimits($node, $annotation);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,6 +147,27 @@ class Annotation extends \Snowflake\Annotation\Annotation
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Node $node
|
||||
* @param $annotation
|
||||
* @throws
|
||||
*/
|
||||
private function bindLimits($node, $annotation)
|
||||
{
|
||||
if (!isset($annotation[1][2])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$explode = explode(',', $annotation[1][2]);
|
||||
|
||||
[$keyName, $matchs] = $annotation;
|
||||
foreach ($explode as $middleware) {
|
||||
$params = [$keyName, [$matchs[0], $matchs[1], $middleware]];
|
||||
$node->addLimits($this->pop($this->getName(...$params)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $controller
|
||||
* @param $methodName
|
||||
|
||||
Reference in New Issue
Block a user