8000 bug #47218 [Console] fix dispatch signal event check for compatibilit… · symfony/symfony@458b294 · GitHub
[go: up one dir, main page]

Skip to content

Commit 458b294

Browse files
committed
bug #47218 [Console] fix dispatch signal event check for compatibility with the contract interface (xabbuh)
This PR was merged into the 5.4 branch. Discussion ---------- [Console] fix dispatch signal event check for compatibility with the contract interface | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #45333 (comment) | License | MIT | Doc PR | Commits ------- 6b29591 fix dispatch signal event check for compatibility with the contract interface
2 parents ea7149a + 6b29591 commit 458b294

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