fix param for annotation handler

This commit is contained in:
crazywhalecc
2022-08-13 22:04:05 +08:00
committed by Jerry Ma
parent dc742763a8
commit d56f9d6e6e
2 changed files with 4 additions and 4 deletions

View File

@@ -126,7 +126,7 @@ class AnnotationHandler
* @throws InterruptException
* @throws Throwable
*/
public function handle(AnnotationBase $v, ?callable $rule_callback = null): bool
public function handle(AnnotationBase $v, ?callable $rule_callback = null, ...$args): bool
{
// 由于3.0有额外的插件模式支持,所以注解就不再提供独立的闭包函数调用支持了
// 提取要调用的目标类和方法名称
@@ -139,7 +139,7 @@ class AnnotationHandler
}
$callback = [$target_class, $target_method];
try {
$this->return_val = middleware()->process($callback);
$this->return_val = middleware()->process($callback, ...$args);
} catch (InterruptException $e) {
// 这里直接抛出这个异常的目的就是给上层handleAll()捕获
throw $e;