From 061bfb25b48fbdaa18ef8a0a440b01b949a94237 Mon Sep 17 00:00:00 2001 From: zxin <14545600+NHZEX@users.noreply.github.com> Date: Wed, 20 Mar 2024 18:24:51 +0800 Subject: [PATCH] =?UTF-8?q?[3.0]=20=E4=BC=98=E5=8C=96=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8D=95=E8=8E=B7=E5=A4=84=E7=90=86=20=20(#683)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update: 优化错误捕获处理 解决错误抑制运算符失效问题 * Update: 修复静态分析 --- .../rpc/src/Route/Event/RpcAnnotationParserEvent.php | 3 ++- src/Log/ErrorLog.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Components/rpc/src/Route/Event/RpcAnnotationParserEvent.php b/src/Components/rpc/src/Route/Event/RpcAnnotationParserEvent.php index d781deb1a..4bdf79450 100644 --- a/src/Components/rpc/src/Route/Event/RpcAnnotationParserEvent.php +++ b/src/Components/rpc/src/Route/Event/RpcAnnotationParserEvent.php @@ -9,7 +9,8 @@ class RpcAnnotationParserEvent extends CommonEvent { public function __construct( - string $__eventName, ?object $__target = null, + string $__eventName, + ?object $__target, public readonly \Imi\Bean\Annotation\Base $annotation, public readonly string $className, public readonly string $target, diff --git a/src/Log/ErrorLog.php b/src/Log/ErrorLog.php index d88c83051..843ebbdc2 100644 --- a/src/Log/ErrorLog.php +++ b/src/Log/ErrorLog.php @@ -51,6 +51,10 @@ public function register(): void */ public function onError(int $errno, string $errstr, string $errfile, int $errline): void { + if (0 === (error_reporting() & $errno)) + { + return; + } foreach ($this->errorEventHandlers as $class) { $handler = new $class();