diff --git a/src/AnnotatedCommand.php b/src/AnnotatedCommand.php index bdf0cb7..2408c8b 100644 --- a/src/AnnotatedCommand.php +++ b/src/AnnotatedCommand.php @@ -259,7 +259,7 @@ private function addInputOption($inputOption, $description = null) // Alas, Symfony provides no accessor. $class = new \ReflectionClass($inputOption); $property = $class->getProperty('suggestedValues'); - $property->setAccessible(true); + (\PHP_VERSION_ID < 80100) and $property->setAccessible(true); $suggestedValues = $property->getValue($inputOption); } $this->addOption( diff --git a/tests/AnnotatedCommandFactoryTest.php b/tests/AnnotatedCommandFactoryTest.php index 6cd7ba9..abb11c3 100644 --- a/tests/AnnotatedCommandFactoryTest.php +++ b/tests/AnnotatedCommandFactoryTest.php @@ -1216,7 +1216,7 @@ function ($output, $message) { function callProtected($object, $method, $args = []) { $r = new \ReflectionMethod($object, $method); - $r->setAccessible(true); + (\PHP_VERSION_ID < 80100) and $r->setAccessible(true); return $r->invokeArgs($object, $args); } diff --git a/tests/FullStackTest.php b/tests/FullStackTest.php index 3be8567..6287e71 100644 --- a/tests/FullStackTest.php +++ b/tests/FullStackTest.php @@ -512,7 +512,7 @@ function simplifyWhitespace($data) function callProtected($object, $method, $args = []) { $r = new \ReflectionMethod($object, $method); - $r->setAccessible(true); + (\PHP_VERSION_ID < 80100) and $r->setAccessible(true); return $r->invokeArgs($object, $args); } diff --git a/tests/FullyQualifiedClassCacheTest.php b/tests/FullyQualifiedClassCacheTest.php index c366649..ca24a6d 100644 --- a/tests/FullyQualifiedClassCacheTest.php +++ b/tests/FullyQualifiedClassCacheTest.php @@ -40,7 +40,7 @@ function testFqcn() function callProtected($object, $method, $args = []) { $r = new \ReflectionMethod($object, $method); - $r->setAccessible(true); + (\PHP_VERSION_ID < 80100) and $r->setAccessible(true); return $r->invokeArgs($object, $args); } }