From a3011c7b7adb58d89f6c0d822abb641d7a5f9719 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Mon, 7 Apr 2025 16:42:41 +0100 Subject: [PATCH] Correctly convert SIGSYS to its name --- SignalRegistry/SignalMap.php | 2 +- Tests/SignalRegistry/SignalMapTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SignalRegistry/SignalMap.php b/SignalRegistry/SignalMap.php index de419bda7..2f9aa67c1 100644 --- a/SignalRegistry/SignalMap.php +++ b/SignalRegistry/SignalMap.php @@ -27,7 +27,7 @@ public static function getSignalName(int $signal): ?string if (!isset(self::$map)) { $r = new \ReflectionExtension('pcntl'); $c = $r->getConstants(); - $map = array_filter($c, fn ($k) => str_starts_with($k, 'SIG') && !str_starts_with($k, 'SIG_'), \ARRAY_FILTER_USE_KEY); + $map = array_filter($c, fn ($k) => str_starts_with($k, 'SIG') && !str_starts_with($k, 'SIG_') && 'SIGBABY' !== $k, \ARRAY_FILTER_USE_KEY); self::$map = array_flip($map); } diff --git a/Tests/SignalRegistry/SignalMapTest.php b/Tests/SignalRegistry/SignalMapTest.php index 887c5d7af..f4e320477 100644 --- a/Tests/SignalRegistry/SignalMapTest.php +++ b/Tests/SignalRegistry/SignalMapTest.php @@ -22,6 +22,7 @@ class SignalMapTest extends TestCase * @testWith [2, "SIGINT"] * [9, "SIGKILL"] * [15, "SIGTERM"] + * [31, "SIGSYS"] */ public function testSignalExists(int $signal, string $expected) {