8000 fix dispatch signal event check for compatibility with the contract i… · symfony/symfony@6b29591 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b29591

Browse files
committed
fix dispatch signal event check for compatibility with the contract interface
1 parent 0ad8230 commit 6b29591

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Symfony/Component/Console/Application.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -985,9 +985,8 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
985985

986986
if ($this->signalsToDispatchEvent) {
987987
$commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : [];
988-
$dispatchSignals = $this->dispatcher && $this->dispatcher->hasListeners(ConsoleEvents::SIGNAL);
989988

990-
if ($commandSignals || $dispatchSignals) {
989+
if ($commandSignals || null !== $this->dispatcher) {
991990
if (!$this->signalRegistry) {
992991
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.');
993992
}
@@ -1007,7 +1006,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
10071006
}
10081007
}
10091008

1010-
if ($dispatchSignals) {
1009+
if (null !== $this->dispatcher) {
10111010
foreach ($this->signalsToDispatchEvent as $signal) {
10121011
$event = new ConsoleSignalEvent($command, $input, $output, $signal);
10131012

0 commit comments

Comments
 (0)
0