Skip to content

Commit

Permalink
[10.x] Allows to defer resolving pcntl only if it's available
Browse files Browse the repository at this point in the history
fixes #50022

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Feb 9, 2024
1 parent 1d0f002 commit a7c6e58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Illuminate/Console/Concerns/InteractsWithSignals.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ trait InteractsWithSignals
/**
* Define a callback to be run when the given signal(s) occurs.
*
* @param iterable<array-key, int>|int $signals
* @template TSignals of iterable<array-key, int>|int
*
* @param (\Closure():(TSignals))|TSignals $signals
* @param callable(int $signal): void $callback
* @return void
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Console/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ protected function startProcess($hasEnvironment)
return in_array($key, static::$passthroughVariables) ? [$key => $value] : [$key => false];
})->all());

$this->trap([SIGTERM, SIGINT, SIGHUP, SIGUSR1, SIGUSR2, SIGQUIT], function ($signal) use ($process) {
$this->trap(fn () => [SIGTERM, SIGINT, SIGHUP, SIGUSR1, SIGUSR2, SIGQUIT], function ($signal) use ($process) {
if ($process->isRunning()) {
$process->stop(10, $signal);
}
Expand Down

0 comments on commit a7c6e58

Please sign in to comment.