Skip to content

Commit 8fe5650

Browse files
committed
fix dispatch signal event check for compatibility with the contract interface
1 parent 7490104 commit 8fe5650

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy