10000 [Console] Fix Application::getSignalRegistry() retval · symfony/symfony@119af3c · GitHub
[go: up one dir, main page]

Skip to content

Commit 119af3c

Browse files
committed
[Console] Fix Application::getSignalRegistry() retval
1 parent abbb3d0 commit 119af3c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/Console/Application.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function setCommandLoader(CommandLoaderInterface $commandLoader)
108108
$this->commandLoader = $commandLoader;
109109
}
110110

111-
public function getSignalRegistry(): SignalRegistry
111+
public function getSignalRegistry(): ?SignalRegistry
112112
{
113113
return $this->signalRegistry;
114114
}
@@ -282,7 +282,7 @@ public function doRun(InputInterface $input, OutputInterface $output)
282282
$command = $this->find($alternative);
283283
}
284284

285-
if ($this->dispatcher) {
285+
if ($this->dispatcher && $this->signalRegistry) {
286286
foreach ($this->signalsToDispatchEvent as $signal) {
287287
$event = new ConsoleSignalEvent($command, $input, $output, $signal);
288288

@@ -954,7 +954,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
954954
}
955955

956956
if ($command instanceof SignalableCommandInterface) {
957-
if (!$this->signalsToDispatchEvent) {
957+
if (!$this->signalRegistry) {
958958
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.');
959959
}
960960
foreach ($command->getSubscribedSignals() as $signal) {

0 commit comments

Comments
 (0)
0