@@ -25,7 +25,9 @@ public function testCreateWithHttpClientWorks(): void
2525 $ api = new class ($ client ) extends AbstractApi {};
2626
2727 $ method = new ReflectionMethod ($ api , 'getHttpClient ' );
28- $ method ->setAccessible (true );
28+ if (PHP_VERSION_ID < 80100 ) {
29+ $ method ->setAccessible (true );
30+ }
2931
3032 $ this ->assertSame ($ client , $ method ->invoke ($ api ));
3133 }
@@ -37,7 +39,9 @@ public function testCreateWitClientWorks(): void
3739 $ api = new class ($ client ) extends AbstractApi {};
3840
3941 $ method = new ReflectionMethod ($ api , 'getHttpClient ' );
40- $ method ->setAccessible (true );
42+ if (PHP_VERSION_ID < 80100 ) {
43+ $ method ->setAccessible (true );
44+ }
4145
4246 $ this ->assertInstanceOf (HttpClient::class, $ method ->invoke ($ api ));
4347 }
@@ -183,7 +187,9 @@ public function testIsNotNullReturnsCorrectBoolean(bool $expected, $value): void
183187 $ api = new class ($ client ) extends AbstractApi {};
184188
185189 $ method = new ReflectionMethod ($ api , 'isNotNull ' );
186- $ method ->setAccessible (true );
190+ if (PHP_VERSION_ID < 80100 ) {
191+ $ method ->setAccessible (true );
192+ }
187193
188194 $ this ->assertSame ($ expected , $ method ->invoke ($ api , $ value ));
189195 }
@@ -375,7 +381,9 @@ public function testRetrieveData(string $path, string $contentType, string $resp
375381 $ api = new class ($ client ) extends AbstractApi {};
376382
377383 $ method = new ReflectionMethod ($ api , 'retrieveData ' );
378- $ method ->setAccessible (true );
384+ if (PHP_VERSION_ID < 80100 ) {
385+ $ method ->setAccessible (true );
386+ }
379387
380388 $ this ->assertSame ($ expected , $ method ->invoke ($ api , $ path ));
381389 }
@@ -410,7 +418,9 @@ public function testRetrieveDataWith100ResultsMakes1Request(): void
410418 $ api = new class ($ client ) extends AbstractApi {};
411419
412420 $ method = new ReflectionMethod ($ api , 'retrieveData ' );
413- $ method ->setAccessible (true );
421+ if (PHP_VERSION_ID < 80100 ) {
422+ $ method ->setAccessible (true );
423+ }
414424
415425 $ method ->invoke ($ api , '/data.json ' , ['limit ' => 101 ]);
416426 }
@@ -435,7 +445,9 @@ public function testRetrieveDataWith250ResultsMakes3Requests(): void
435445 $ api = new class ($ client ) extends AbstractApi {};
436446
437447 $ method = new ReflectionMethod ($ api , 'retrieveData ' );
438- $ method ->setAccessible (true );
448+ if (PHP_VERSION_ID < 80100 ) {
449+ $ method ->setAccessible (true );
450+ }
439451
440452 $ method ->invoke ($ api , '/data.json ' , ['limit ' => 301 ]);
441453 }
@@ -454,7 +466,9 @@ public function testRetrieveDataThrowsException(string $response, string $conten
454466 $ api = new class ($ client ) extends AbstractApi {};
455467
456468 $ method = new ReflectionMethod ($ api , 'retrieveData ' );
457- $ method ->setAccessible (true );
469+ if (PHP_VERSION_ID < 80100 ) {
470+ $ method ->setAccessible (true );
471+ }
458472
459473 $ this ->expectException ($ expectedException );
460474 $ this ->expectExceptionMessage ($ expectedMessage );
@@ -483,7 +497,9 @@ public function testDeprecatedRetrieveAll(string $content, string $contentType,
483497 $ api = new class ($ client ) extends AbstractApi {};
484498
485499 $ method = new ReflectionMethod ($ api , 'retrieveAll ' );
486- $ method ->setAccessible (true );
500+ if (PHP_VERSION_ID < 80100 ) {
501+ $ method ->setAccessible (true );
502+ }
487503
488504 $ this ->assertSame ($ expected , $ method ->invoke ($ api , '' ));
489505 }
@@ -504,7 +520,9 @@ public function testDeprecatedAttachCustomFieldXML(): void
504520 $ api = new class ($ client ) extends AbstractApi {};
505521
506522 $ method = new ReflectionMethod ($ api , 'attachCustomFieldXML ' );
507- $ method ->setAccessible (true );
523+ if (PHP_VERSION_ID < 80100 ) {
524+ $ method ->setAccessible (true );
525+ }
508526
509527 $ xml = new SimpleXMLElement ('<?xml version="1.0"?><issue/> ' );
510528
0 commit comments