refactor(php): 移除不再使用的 isWindows 属性

- 删除了 CompilerBase 类中的 isWindows 保护属性
- 移除了 initialize 和 getPlatform 方法中对 isWindows 的赋值操作
- 直接在条件判断中使用 platform 实例检查替代 isWindows 属性功能
pull/1/head
韩天峰 4 months ago
parent 460ec638df
commit cc785eb7f7
  1. 3
      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;

Loading…
Cancel
Save