From 8ec68173ce8461fec813d8def916c6f0ce71fb44 Mon Sep 17 00:00:00 2001 From: fadrian06 Date: Tue, 23 Jun 2026 14:04:47 -0400 Subject: [PATCH] validate ->setAccesible --- tests/LoaderTest.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/LoaderTest.php b/tests/LoaderTest.php index efe6c6d..bffd7d1 100644 --- a/tests/LoaderTest.php +++ b/tests/LoaderTest.php @@ -145,7 +145,11 @@ class LoaderTest extends TestCase $loader::addDirectory([__DIR__ . '/classes']); $dirsProperty = (new ReflectionClass(Loader::class))->getProperty('dirs'); - $dirsProperty->setAccessible(true); + + if (PHP_VERSION_ID < 80100) { + $dirsProperty->setAccessible(true); + } + $dirs = $dirsProperty->getValue($loader); self::assertEquals([__DIR__ . DIRECTORY_SEPARATOR . 'classes'], $dirs); @@ -156,7 +160,10 @@ class LoaderTest extends TestCase $loader = new Loader(); $v2ClassLoadingProperty = (new ReflectionClass(Loader::class))->getProperty('v2ClassLoading'); - $v2ClassLoadingProperty->setAccessible(true); + + if (PHP_VERSION_ID < 80100) { + $v2ClassLoadingProperty->setAccessible(true); + } $this->assertTrue($v2ClassLoadingProperty->getValue($loader)); $loader::setV2ClassLoading(false);