@@ -42,7 +42,9 @@ public function testStaticAddReadStreamCallsAddReadStreamOnLoopInstance()
4242 public function testStaticAddReadStreamWithNoDefaultLoopCallsAddReadStreamOnNewLoopInstance ()
4343 {
4444 $ ref = new \ReflectionProperty (Loop::class, 'instance ' );
45- $ ref ->setAccessible (true );
45+ if (PHP_VERSION_ID < 80100 ) {
46+ $ ref ->setAccessible (true );
47+ }
4648 $ ref ->setValue (null , null );
4749
4850 $ stream = stream_socket_server ('127.0.0.1:0 ' );
@@ -68,7 +70,9 @@ public function testStaticAddWriteStreamCallsAddWriteStreamOnLoopInstance()
6870 public function testStaticAddWriteStreamWithNoDefaultLoopCallsAddWriteStreamOnNewLoopInstance ()
6971 {
7072 $ ref = new \ReflectionProperty (Loop::class, 'instance ' );
71- $ ref ->setAccessible (true );
73+ if (PHP_VERSION_ID < 80100 ) {
74+ $ ref ->setAccessible (true );
75+ }
7276 $ ref ->setValue (null , null );
7377
7478 $ stream = stream_socket_server ('127.0.0.1:0 ' );
@@ -93,7 +97,9 @@ public function testStaticRemoveReadStreamCallsRemoveReadStreamOnLoopInstance()
9397 public function testStaticRemoveReadStreamWithNoDefaultLoopIsNoOp ()
9498 {
9599 $ ref = new \ReflectionProperty (Loop::class, 'instance ' );
96- $ ref ->setAccessible (true );
100+ if (PHP_VERSION_ID < 80100 ) {
101+ $ ref ->setAccessible (true );
102+ }
97103 $ ref ->setValue (null , null );
98104
99105 $ stream = tmpfile ();
@@ -117,7 +123,9 @@ public function testStaticRemoveWriteStreamCallsRemoveWriteStreamOnLoopInstance(
117123 public function testStaticRemoveWriteStreamWithNoDefaultLoopIsNoOp ()
118124 {
119125 $ ref = new \ReflectionProperty (Loop::class, 'instance ' );
120- $ ref ->setAccessible (true );
126+ if (PHP_VERSION_ID < 80100 ) {
127+ $ ref ->setAccessible (true );
128+ }
121129 $ ref ->setValue (null , null );
122130
123131 $ stream = tmpfile ();
@@ -145,7 +153,9 @@ public function testStaticAddTimerCallsAddTimerOnLoopInstanceAndReturnsTimerInst
145153 public function testStaticAddTimerWithNoDefaultLoopCallsAddTimerOnNewLoopInstance ()
146154 {
147155 $ ref = new \ReflectionProperty (Loop::class, 'instance ' );
148- $ ref ->setAccessible (true );
156+ if (PHP_VERSION_ID < 80100 ) {
157+ $ ref ->setAccessible (true );
158+ }
149159 $ ref ->setValue (null , null );
150160
151161 $ interval = 1.0 ;
@@ -175,7 +185,9 @@ public function testStaticAddPeriodicTimerCallsAddPeriodicTimerOnLoopInstanceAnd
175185 public function testStaticAddPeriodicTimerWithNoDefaultLoopCallsAddPeriodicTimerOnNewLoopInstance ()
176186 {
177187 $ ref = new \ReflectionProperty (Loop::class, 'instance ' );
178- $ ref ->setAccessible (true );
188+ if (PHP_VERSION_ID < 80100 ) {
189+ $ ref ->setAccessible (true );
190+ }
179191 $ ref ->setValue (null , null );
180192
181193 $ interval = 1.0 ;
@@ -202,7 +214,9 @@ public function testStaticCancelTimerCallsCancelTimerOnLoopInstance()
202214 public function testStaticCancelTimerWithNoDefaultLoopIsNoOp ()
203215 {
204216 $ ref = new \ReflectionProperty (Loop::class, 'instance ' );
205- $ ref ->setAccessible (true );
217+ if (PHP_VERSION_ID < 80100 ) {
218+ $ ref ->setAccessible (true );
219+ }
206220 $ ref ->setValue (null , null );
207221
208222 $ timer = $ this ->createMock (TimerInterface::class);
@@ -226,7 +240,9 @@ public function testStaticFutureTickCallsFutureTickOnLoopInstance()
226240 public function testStaticFutureTickWithNoDefaultLoopCallsFutureTickOnNewLoopInstance ()
227241 {
228242 $ ref = new \ReflectionProperty (Loop::class, 'instance ' );
229- $ ref ->setAccessible (true );
243+ if (PHP_VERSION_ID < 80100 ) {
244+ $ ref ->setAccessible (true );
245+ }
230246 $ ref ->setValue (null , null );
231247
232248 $ listener = function () { };
@@ -255,7 +271,9 @@ public function testStaticAddSignalWithNoDefaultLoopCallsAddSignalOnNewLoopInsta
255271 }
256272
257273 $ ref = new \ReflectionProperty (Loop::class, 'instance ' );
258- $ ref ->setAccessible (true );
274+ if (PHP_VERSION_ID < 80100 ) {
275+ $ ref ->setAccessible (true );
276+ }
259277 $ ref ->setValue (null , null );
260278
261279 $ signal = 1 ;
@@ -285,7 +303,9 @@ public function testStaticRemoveSignalCallsRemoveSignalOnLoopInstance()
285303 public function testStaticRemoveSignalWithNoDefaultLoopIsNoOp ()
286304 {
287305 $ ref = new \ReflectionProperty (Loop::class, 'instance ' );
288- $ ref ->setAccessible (true );
306+ if (PHP_VERSION_ID < 80100 ) {
307+ $ ref ->setAccessible (true );
308+ }
289309 $ ref ->setValue (null , null );
290310
291311 $ signal = 1 ;
@@ -308,7 +328,9 @@ public function testStaticRunCallsRunOnLoopInstance()
308328 public function testStaticRunWithNoDefaultLoopCallsRunsOnNewLoopInstance ()
309329 {
310330 $ ref = new \ReflectionProperty (Loop::class, 'instance ' );
311- $ ref ->setAccessible (true );
331+ if (PHP_VERSION_ID < 80100 ) {
332+ $ ref ->setAccessible (true );
333+ }
312334 $ ref ->setValue (null , null );
313335
314336 Loop::run ();
@@ -329,7 +351,9 @@ public function testStaticStopCallsStopOnLoopInstance()
329351 public function testStaticStopCallWithNoDefaultLoopIsNoOp ()
330352 {
331353 $ ref = new \ReflectionProperty (Loop::class, 'instance ' );
332- $ ref ->setAccessible (true );
354+ if (PHP_VERSION_ID < 80100 ) {
355+ $ ref ->setAccessible (true );
356+ }
333357 $ ref ->setValue (null , null );
334358
335359 Loop::stop ();
@@ -344,7 +368,9 @@ public function testStaticStopCallWithNoDefaultLoopIsNoOp()
344368 public function unsetLoopFromLoopAccessor ()
345369 {
346370 $ ref = new \ReflectionProperty (Loop::class, 'instance ' );
347- $ ref ->setAccessible (true );
371+ if (PHP_VERSION_ID < 80100 ) {
372+ $ ref ->setAccessible (true );
373+ }
348374 $ ref ->setValue (null , null );
349375 }
350376}
0 commit comments