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)
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