File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ public function __construct()
26
26
27
27
public function beforeSocket ()
28
28
{
29
+ // PHP 7.1 and higher
30
+ if (false == function_exists ('pcntl_signal_get_handler ' )) {
31
+ return ;
32
+ }
33
+
29
34
if ($ this ->handlers ) {
30
35
throw new \LogicException ('The handlers property should be empty but it is not. The afterSocket method might not have been called. ' );
31
36
}
@@ -52,6 +57,11 @@ public function beforeSocket()
52
57
53
58
public function afterSocket ()
54
59
{
60
+ // PHP 7.1 and higher
61
+ if (false == function_exists ('pcntl_signal_get_handler ' )) {
62
+ return ;
63
+ }
64
+
55
65
$ this ->wasThereSignal = null ;
56
66
57
67
foreach ($ this ->signals as $ signal ) {
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ public function setUp()
20
20
{
21
21
parent ::setUp ();
22
22
23
+ if (false == function_exists ('pcntl_signal_get_handler ' )) {
24
+ $ this ->markTestSkipped ('PHP 7.1 and higher ' );
25
+ }
26
+
23
27
$ this ->backupSigTermHandler = pcntl_signal_get_handler (SIGTERM );
24
28
$ this ->backupSigIntHandler = pcntl_signal_get_handler (SIGINT );
25
29
You can’t perform that action at this time.
0 commit comments