# Bug report We use PHP 8.1 where [setAccessible is no longer needed to be called](https://www.php.net/manual/en/reflectionproperty.setaccessible.php), but it is checked in [the adapter](https://github.com/ondrejmirtes/BetterReflection/blob/5.3.x/src/Reflection/Adapter/ReflectionMethod.php#L308). Repository ondrejmirtes/BetterReflection does not accept issues so I placed it here. Tested on 1.7.11 ### Code snippet that reproduces the problem ```php $this->reflectionProvider->getClass($className)->getNativeReflection()->getMethod($privateMethodName)->invoke(null); // in custom rule ``` ### Expected output No error