Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e44405d

Browse filesBrowse files
committed
Fixes for review on run commands without signals
1 parent 07b76dc commit e44405d
Copy full SHA for e44405d

File tree

2 files changed

+3
-2
lines changed
Filter options

2 files changed

+3
-2
lines changed

‎src/Symfony/Component/Console/Application.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Application.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
940940
}
941941
}
942942

943-
if ($command instanceof SignalableCommandInterface && !(empty($this->signalsToDispatchEvent) && empty($command->getSubscribedSignals()))) {
943+
if ($command instanceof SignalableCommandInterface && ($this->signalsToDispatchEvent || $command->getSubscribedSignals())) {
944944
if (!$this->signalRegistry) {
945945
throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.');
946946
}

‎src/Symfony/Component/Console/Tests/ApplicationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/ApplicationTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
use Symfony\Component\Console\Output\Output;
3737
use Symfony\Component\Console\Output\OutputInterface;
3838
use Symfony\Component\Console\Output\StreamOutput;
39+
use Symfony\Component\Console\SignalRegistry\SignalRegistry;
3940
use Symfony\Component\Console\Tester\ApplicationTester;
4041
use Symfony\Component\DependencyInjection\ContainerBuilder;
4142
use Symfony\Component\EventDispatcher\EventDispatcher;
@@ -1940,7 +1941,7 @@ class SignableCommand extends Command implements SignalableCommandInterface
19401941

19411942
public function getSubscribedSignals(): array
19421943
{
1943-
return !\function_exists('pcntl_signal') || \in_array('pcntl_signal', explode(',', ini_get('disable_functions'))) ? [] : [\SIGALRM];
1944+
return SignalRegistry::isSupported() ? [\SIGALRM] : [];
19441945
}
19451946

19461947
public function handleSignal(int $signal): void

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.