Fix argument naming in InstallPackageCommand for clarity (#989)

This commit is contained in:
Jerry Ma
2025-12-06 16:57:16 +08:00
committed by GitHub
parent 9ad7147155
commit d3b0f5de79

View File

@@ -8,19 +8,19 @@ use StaticPHP\DI\ApplicationContext;
use StaticPHP\Package\PackageInstaller; use StaticPHP\Package\PackageInstaller;
use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Attribute\AsCommand;
#[AsCommand('install-pkg', 'Install additional packages', ['i', 'install-package'])] #[AsCommand('install-pkg', 'Install additional package', ['i', 'install-package'])]
class InstallPackageCommand extends BaseCommand class InstallPackageCommand extends BaseCommand
{ {
public function configure() public function configure()
{ {
$this->addArgument('packages', null, 'The package to install (name or path)'); $this->addArgument('package', null, 'The package to install (name or path)');
} }
public function handle(): int public function handle(): int
{ {
ApplicationContext::set('elephant', true); ApplicationContext::set('elephant', true);
$installer = new PackageInstaller([...$this->input->getOptions(), 'dl-prefer-binary' => true]); $installer = new PackageInstaller([...$this->input->getOptions(), 'dl-prefer-binary' => true]);
$installer->addInstallPackage($this->input->getArgument('packages')); $installer->addInstallPackage($this->input->getArgument('package'));
$installer->run(true, true); $installer->run(true, true);
return static::SUCCESS; return static::SUCCESS;
} }