mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-10 10:25:36 +08:00
Use container instead of passing
This commit is contained in:
@@ -35,16 +35,10 @@ class WindowsCMakeExecutor extends Executor
|
|||||||
|
|
||||||
protected PackageInstaller $installer;
|
protected PackageInstaller $installer;
|
||||||
|
|
||||||
public function __construct(protected LibraryPackage $package, ?PackageBuilder $builder = null)
|
public function __construct(protected LibraryPackage $package)
|
||||||
{
|
{
|
||||||
parent::__construct($this->package);
|
parent::__construct($this->package);
|
||||||
if ($builder !== null) {
|
$this->builder = ApplicationContext::get(PackageBuilder::class);
|
||||||
$this->builder = $builder;
|
|
||||||
} elseif (ApplicationContext::has(PackageBuilder::class)) {
|
|
||||||
$this->builder = ApplicationContext::get(PackageBuilder::class);
|
|
||||||
} else {
|
|
||||||
throw new SPCInternalException('PackageBuilder not found in ApplicationContext.');
|
|
||||||
}
|
|
||||||
$this->installer = ApplicationContext::get(PackageInstaller::class);
|
$this->installer = ApplicationContext::get(PackageInstaller::class);
|
||||||
$this->initCmd();
|
$this->initCmd();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user