Skip to content

Commit e11c355

Browse files
committed
cs
1 parent 1163553 commit e11c355

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.php-cs-fixer.dist.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@
3232
'equal' => false,
3333
'identical' => false,
3434
],
35-
'native_constant_invocation' => true,
35+
'native_constant_invocation' => [
36+
'include' => [
37+
// https://github.com/php/php-src/blob/php-8.4.0/ext/pcntl/pcntl.stub.php#L201
38+
'SIGALRM',
39+
],
40+
],
3641
'native_function_invocation' => false,
3742
'void_return' => false,
3843
'blank_line_before_statement' => [

src/util/PcntlTimeout.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ public function __construct(int $timeout)
6767
*/
6868
public function timeBoxed(callable $code)
6969
{
70-
$existingHandler = pcntl_signal_get_handler(SIGALRM);
70+
$existingHandler = pcntl_signal_get_handler(\SIGALRM);
7171

72-
$signal = pcntl_signal(SIGALRM, function (): void {
72+
$signal = pcntl_signal(\SIGALRM, function (): void {
7373
throw new DeadlineException(sprintf(
7474
'Timebox hit deadline of %d seconds',
7575
$this->timeout
@@ -89,7 +89,7 @@ public function timeBoxed(callable $code)
8989
} finally {
9090
pcntl_alarm(0);
9191
pcntl_signal_dispatch();
92-
pcntl_signal(SIGALRM, $existingHandler);
92+
pcntl_signal(\SIGALRM, $existingHandler);
9393
}
9494
}
9595

0 commit comments

Comments
 (0)