Skip to content

Commit a3011c7

Browse files
committed
Correctly convert SIGSYS to its name
1 parent 2e4af9c commit a3011c7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

SignalRegistry/SignalMap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function getSignalName(int $signal): ?string
2727
if (!isset(self::$map)) {
2828
$r = new \ReflectionExtension('pcntl');
2929
$c = $r->getConstants();
30-
$map = array_filter($c, fn ($k) => str_starts_with($k, 'SIG') && !str_starts_with($k, 'SIG_'), \ARRAY_FILTER_USE_KEY);
30+
$map = array_filter($c, fn ($k) => str_starts_with($k, 'SIG') && !str_starts_with($k, 'SIG_') && 'SIGBABY' !== $k, \ARRAY_FILTER_USE_KEY);
3131
self::$map = array_flip($map);
3232
}
3333

Tests/SignalRegistry/SignalMapTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class SignalMapTest extends TestCase
2222
* @testWith [2, "SIGINT"]
2323
* [9, "SIGKILL"]
2424
* [15, "SIGTERM"]
25+
* [31, "SIGSYS"]
2526
*/
2627
public function testSignalExists(int $signal, string $expected)
2728
{

0 commit comments

Comments
 (0)