File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -50,19 +50,20 @@ private static function init(): void
50
50
return ;
51
51
}
52
52
53
- if (! function_exists ('pcntl_async_signals ' )) {
53
+ if (!function_exists ('pcntl_async_signals ' )) {
54
54
trigger_error ('Could not enable timeout exceptions because pcntl extension is not enabled. ' );
55
+
55
56
return ;
56
57
}
57
58
58
59
pcntl_async_signals (true );
59
60
// Setup a handler for SIGALRM that throws an exception
60
61
// This will interrupt any running PHP code, including `sleep()` or code stuck waiting for I/O.
61
62
pcntl_signal (SIGALRM , function (): void {
62
- if (Timeout:: $ stackTrace !== null ) {
63
+ if (null !== Timeout:: $ stackTrace ) {
63
64
// we have already thrown an exception, do a harder exit.
64
65
error_log ('Lambda timed out ' );
65
- error_log ((new LambdaTimeoutException )->getTraceAsString ());
66
+ error_log ((new LambdaTimeoutException () )->getTraceAsString ());
66
67
error_log ('Original stack trace ' );
67
68
error_log (Timeout::$ stackTrace );
68
69
Original file line number Diff line number Diff line change 2
2
3
3
namespace Runtime \Bref \Tests ;
4
4
5
+ use PHPUnit \Framework \TestCase ;
5
6
use Runtime \Bref \Timeout \LambdaTimeoutException ;
6
7
use Runtime \Bref \Timeout \Timeout ;
7
- use PHPUnit \Framework \TestCase ;
8
8
9
9
class TimeoutTest extends TestCase
10
10
{
11
11
public static function setUpBeforeClass (): void
12
12
{
13
- if (! function_exists ('pcntl_async_signals ' )) {
13
+ if (!function_exists ('pcntl_async_signals ' )) {
14
14
self ::markTestSkipped ('PCNTL extension is not enabled. ' );
15
15
}
16
16
}
You can’t perform that action at this time.
0 commit comments