strict SignalListener param type

This commit is contained in:
crazywhalecc
2022-04-03 01:22:19 +08:00
committed by Jerry Ma
parent ba64f2c189
commit 9bd02b3dd2
2 changed files with 3 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ use ZM\Utils\SignalListener;
*/
class OnWorkerStart implements SwooleEvent
{
public function onCall(Server $server, $worker_id)
public function onCall(Server $server, int $worker_id)
{
Console::debug('Calling onWorkerStart event(1)');
if (!Framework::$argv['disable-safe-exit']) {

View File

@@ -63,9 +63,9 @@ class SignalListener
/**
* 监听Worker/TaskWorker进程的Ctrl+C
* @param int|string $worker_id 当前进程的ID
* @param int $worker_id 当前进程的ID
*/
public static function signalWorker(Server $server, $worker_id)
public static function signalWorker(Server $server, int $worker_id)
{
Console::debug('Listening Worker #' . $worker_id . ' SIGINT');
Process::signal(SIGINT, function () use ($server) {