diff --git a/src/Symfony/Component/Console/SignalRegistry/SignalMap.php b/src/Symfony/Component/Console/SignalRegistry/SignalMap.php index de419bda79821..2f9aa67c156db 100644 --- a/src/Symfony/Component/Console/SignalRegistry/SignalMap.php +++ b/src/Symfony/Component/Console/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/src/Symfony/Component/Console/Tests/SignalRegistry/SignalMapTest.php b/src/Symfony/Component/Console/Tests/SignalRegistry/SignalMapTest.php index 887c5d7af01c5..f4e320477d4be 100644 --- a/src/Symfony/Component/Console/Tests/SignalRegistry/SignalMapTest.php +++ b/src/Symfony/Component/Console/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) {