Skip to content

Commit

Permalink
fix: remove SignalableCommandInterface from the get command to be…
Browse files Browse the repository at this point in the history
… compatible with SF Console 4.x, 5.x; fix changelog and program version (#9)
  • Loading branch information
roxblnfk authored Jul 20, 2024
1 parent 76d681d commit 383880f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 0.2.1 (2024-07-20)

## What's Changed
* Fixed asset file extension detection by @roxblnfk
* Updated min version of `yiisoft/injector` by @roxblnfk

**Full Changelog**: https://github.com/php-internal/dload/compare/0.2.0...0.2.1

## 0.2.0 (2024-07-19)
Expand Down
1 change: 1 addition & 0 deletions bin/dload
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ if ('cli' !== PHP_SAPI) {
);
$application->setDefaultCommand(Command\Get::getDefaultName(), false);
$application->setVersion(Info::version());
$application->setName(Info::NAME);
$application->run();
})();
27 changes: 1 addition & 26 deletions src/Command/Get.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Internal\DLoad\Module\Common\Stability;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Command\SignalableCommandInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand All @@ -25,7 +24,7 @@
name: 'get',
description: 'Download a binary',
)]
final class Get extends Base implements SignalableCommandInterface
final class Get extends Base
{
private const ARG_SOFTWARE = 'software';

Expand All @@ -39,30 +38,6 @@ public function configure(): void
$this->addOption('stability', null, InputOption::VALUE_OPTIONAL, 'Stability, e.g. "stable", "beta" etc.');
}

public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false
{
if (\defined('SIGINT') && $signal === \SIGINT) {
$this->cancelling = true;
}

if (\defined('SIGTERM') && $signal === \SIGTERM) {
return $signal;
}

return false;
}

public function getSubscribedSignals(): array
{
$result = [];
/** @psalm-suppress MixedAssignment */
\defined('SIGINT') and $result[] = \SIGINT;
/** @psalm-suppress MixedAssignment */
\defined('SIGTERM') and $result[] = \SIGTERM;

return $result;
}

protected function execute(InputInterface $input, OutputInterface $output): int
{
parent::execute($input, $output);
Expand Down

0 comments on commit 383880f

Please sign in to comment.