mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-17 17:47:13 +00:00
setAccessible() does not have any effect as of PHP 8.1
This commit is contained in:
@@ -77,7 +77,9 @@ final class InvalidTag implements Tag
|
||||
private function flattenExceptionBacktrace(Throwable $exception): void
|
||||
{
|
||||
$traceProperty = (new ReflectionClass(Exception::class))->getProperty('trace');
|
||||
$traceProperty->setAccessible(true);
|
||||
if (PHP_VERSION_ID < 80100) {
|
||||
$traceProperty->setAccessible(true);
|
||||
}
|
||||
|
||||
do {
|
||||
$trace = $exception->getTrace();
|
||||
@@ -96,7 +98,9 @@ final class InvalidTag implements Tag
|
||||
$exception = $exception->getPrevious();
|
||||
} while ($exception !== null);
|
||||
|
||||
$traceProperty->setAccessible(false);
|
||||
if (PHP_VERSION_ID < 80100) {
|
||||
$traceProperty->setAccessible(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user