You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #60389 [Console] Add support for SignalableCommandInterface with invokable commands (HypeMC)
This PR was merged into the 7.3 branch.
Discussion
----------
[Console] Add support for `SignalableCommandInterface` with invokable commands
| Q | A
| ------------- | ---
| Branch? | 7.3
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Issues | -
| License | MIT
Currently, it's not possible to use the `SignalableCommandInterface` with invokable commands.
This PR adds support for that.
```php
#[AsCommand(name: 'app:example')]
class ExampleCommand implements SignalableCommandInterface
{
public function __invoke(InputInterface $input, OutputInterface $output): int
{
// ...
return Command::SUCCESS;
}
public function getSubscribedSignals(): array
{
return [\SIGINT, \SIGTERM];
}
public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false
{
// handle signal
return 0;
}
}
```
Commits
-------
bb97a2a [Console] Add support for `SignalableCommandInterface` with invokable commands
0 commit comments