add proxy server command and update lowest version of PHP >= 8.0

This commit is contained in:
crazywhalecc
2022-11-03 10:18:17 +08:00
parent 6b34427855
commit 35dec947df
49 changed files with 826 additions and 301 deletions

View File

@@ -4,7 +4,6 @@ declare(strict_types=1);
namespace ZM\Annotation;
use Throwable;
use ZM\Exception\InterruptException;
/**
@@ -89,8 +88,8 @@ class AnnotationHandler
* 调用注册了该注解的所有函数们
* 此处会遍历所有注册了当前注解的函数,并支持中间件插入
*
* @param mixed ...$params 传入的参数们
* @throws Throwable
* @param mixed ...$params 传入的参数们
* @throws \Throwable
*/
public function handleAll(...$params)
{
@@ -113,7 +112,7 @@ class AnnotationHandler
// InterruptException 用于中断,这里必须 catch并标记状态
$this->return_val = $e->return_var;
$this->status = self::STATUS_INTERRUPTED;
} catch (Throwable $e) {
} catch (\Throwable $e) {
// 其他类型的异常就顺势再抛出到外层,此层不做处理
$this->status = self::STATUS_EXCEPTION;
throw $e;
@@ -124,7 +123,7 @@ class AnnotationHandler
* 调用单个注解
*
* @throws InterruptException
* @throws Throwable
* @throws \Throwable
*/
public function handle(AnnotationBase $v, ?callable $rule_callback = null, ...$args): bool
{
@@ -144,7 +143,7 @@ class AnnotationHandler
} catch (InterruptException $e) {
// 这里直接抛出这个异常的目的就是给上层handleAll()捕获
throw $e;
} catch (Throwable $e) {
} catch (\Throwable $e) {
// 其余的异常就交给中间件的异常捕获器过一遍,没捕获的则继续抛出
$this->status = self::STATUS_EXCEPTION;
throw $e;