From cc785eb7f775562efb2fbebf60465d2622529b10 Mon Sep 17 00:00:00 2001 From: rango Date: Sat, 9 May 2026 17:29:30 +0800 Subject: [PATCH] =?UTF-8?q?refactor(php):=20=E7=A7=BB=E9=99=A4=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E4=BD=BF=E7=94=A8=E7=9A=84=20isWindows=20=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除了 CompilerBase 类中的 isWindows 保护属性 - 移除了 initialize 和 getPlatform 方法中对 isWindows 的赋值操作 - 直接在条件判断中使用 platform 实例检查替代 isWindows 属性功能 --- src/Php/CompilerBase.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Php/CompilerBase.php b/src/Php/CompilerBase.php index 781b046d..ebe13f2f 100644 --- a/src/Php/CompilerBase.php +++ b/src/Php/CompilerBase.php @@ -103,7 +103,6 @@ class CompilerBase extends \PhpAot\Core\Translator public const string OP_NOP = "if (0) {}\n"; protected string $lang = 'PHP'; protected string $cppCompiler = ''; - protected bool $isWindows = false; protected array $literalStrings = []; protected int $literalStringIndex = 0; protected int $anonClassIndex = 0; @@ -315,7 +314,6 @@ class CompilerBase extends \PhpAot\Core\Translator { try { $this->platform = PlatformFactory::create(); - $this->isWindows = $this->platform instanceof Windows; $this->cppCompiler = CompilerFactory::detectCompilerName($this->platform); if ($this->platform instanceof Windows) { @@ -423,7 +421,6 @@ class CompilerBase extends \PhpAot\Core\Translator { if ($this->platform === null) { $this->platform = PlatformFactory::create(); - $this->isWindows = $this->platform instanceof Windows; } return $this->platform;