mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
Use container instead of passing
This commit is contained in:
parent
e3f9894331
commit
c4cec15c18
@ -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();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user