File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 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
5050 return ;
5151 }
5252
53- if (! function_exists ('pcntl_async_signals ' )) {
53+ if (!function_exists ('pcntl_async_signals ' )) {
5454 trigger_error ('Could not enable timeout exceptions because pcntl extension is not enabled. ' );
55+
5556 return ;
5657 }
5758
5859 pcntl_async_signals (true );
5960 // Setup a handler for SIGALRM that throws an exception
6061 // This will interrupt any running PHP code, including `sleep()` or code stuck waiting for I/O.
6162 pcntl_signal (SIGALRM , function (): void {
62- if (Timeout:: $ stackTrace !== null ) {
63+ if (null !== Timeout:: $ stackTrace ) {
6364 // we have already thrown an exception, do a harder exit.
6465 error_log ('Lambda timed out ' );
65- error_log ((new LambdaTimeoutException )->getTraceAsString ());
66+ error_log ((new LambdaTimeoutException () )->getTraceAsString ());
6667 error_log ('Original stack trace ' );
6768 error_log (Timeout::$ stackTrace );
6869
Original file line number Diff line number Diff line change 22
33namespace Runtime \Bref \Tests ;
44
5+ use PHPUnit \Framework \TestCase ;
56use Runtime \Bref \Timeout \LambdaTimeoutException ;
67use Runtime \Bref \Timeout \Timeout ;
7- use PHPUnit \Framework \TestCase ;
88
99class TimeoutTest extends TestCase
1010{
1111 public static function setUpBeforeClass (): void
1212 {
13- if (! function_exists ('pcntl_async_signals ' )) {
13+ if (!function_exists ('pcntl_async_signals ' )) {
1414 self ::markTestSkipped ('PCNTL extension is not enabled. ' );
1515 }
1616 }
You can’t perform that action at this time.
0 commit comments