diff --git a/src/Illuminate/Console/Concerns/InteractsWithSignals.php b/src/Illuminate/Console/Concerns/InteractsWithSignals.php index 895072c15c72..c93b98dc4e6d 100644 --- a/src/Illuminate/Console/Concerns/InteractsWithSignals.php +++ b/src/Illuminate/Console/Concerns/InteractsWithSignals.php @@ -17,7 +17,9 @@ trait InteractsWithSignals /** * Define a callback to be run when the given signal(s) occurs. * - * @param iterable|int $signals + * @template TSignals of iterable|int + * + * @param (\Closure():(TSignals))|TSignals $signals * @param callable(int $signal): void $callback * @return void */ @@ -28,7 +30,7 @@ public function trap($signals, $callback) $this->getApplication()->getSignalRegistry(), ); - collect(Arr::wrap($signals)) + collect(Arr::wrap(value($signals))) ->each(fn ($signal) => $this->signals->register($signal, $callback)); }); } diff --git a/src/Illuminate/Foundation/Console/ServeCommand.php b/src/Illuminate/Foundation/Console/ServeCommand.php index 416c8a2801ae..45ba5f9f3629 100644 --- a/src/Illuminate/Foundation/Console/ServeCommand.php +++ b/src/Illuminate/Foundation/Console/ServeCommand.php @@ -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); }