From af0e5df4aeaf5ae0b7d636ce93fff9d2534ee95f Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Wed, 15 Apr 2026 17:17:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(php):=20=E4=BF=AE=E5=A4=8Dtrait=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=99=A8=E4=B8=AD=E7=9A=84=E4=BF=AE=E9=A5=B0=E7=AC=A6?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修正了当newModifier为null时的默认值设置 - 避免了对null值调用toString方法导致的错误 - 确保了trait方法适配的正确性 --- src/Php/Preprocessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Php/Preprocessor.php b/src/Php/Preprocessor.php index 2b865e0a..e21fa3fa 100644 --- a/src/Php/Preprocessor.php +++ b/src/Php/Preprocessor.php @@ -623,7 +623,7 @@ class Preprocessor extends CompilerBase */ $aliases[$this->getFullMethodName($trait1, $methodName)] = [ 'newName' => $adaptation->newName->toString(), - 'newModifier' => $adaptation->newModifier ?: $adaptation->newModifier->toString(), + 'newModifier' => $adaptation->newModifier ?: 0, ]; } if ($adaptation instanceof Node\Stmt\TraitUseAdaptation\Precedence) {