Use container instead of passing

This commit is contained in:
crazywhalecc 2025-12-11 14:45:35 +08:00
parent e3f9894331
commit c4cec15c18

View File

@ -35,16 +35,10 @@ class WindowsCMakeExecutor extends Executor
protected PackageInstaller $installer;
public function __construct(protected LibraryPackage $package, ?PackageBuilder $builder = null)
public function __construct(protected LibraryPackage $package)
{
parent::__construct($this->package);
if ($builder !== null) {
$this->builder = $builder;
} elseif (ApplicationContext::has(PackageBuilder::class)) {
$this->builder = ApplicationContext::get(PackageBuilder::class);
} else {
throw new SPCInternalException('PackageBuilder not found in ApplicationContext.');
}
$this->builder = ApplicationContext::get(PackageBuilder::class);
$this->installer = ApplicationContext::get(PackageInstaller::class);
$this->initCmd();