From 86c553f87b487903337369199d7aea9862227238 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Tue, 30 Dec 2025 15:10:44 +0000 Subject: [PATCH] PimpleTest: Only call setAccessible on PHP < 8.1 https://www.php.net/manual/en/reflectionproperty.setaccessible.php > Note: As of PHP 8.1.0, calling this method has no effect; all properties are accessible by default. --- src/Pimple/Tests/PimpleTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Pimple/Tests/PimpleTest.php b/src/Pimple/Tests/PimpleTest.php index 40e87f4..d88ca6d 100644 --- a/src/Pimple/Tests/PimpleTest.php +++ b/src/Pimple/Tests/PimpleTest.php @@ -275,11 +275,15 @@ public function testExtendDoesNotLeakWithFactories() unset($pimple['foo']); $p = new \ReflectionProperty($pimple, 'values'); - $p->setAccessible(true); + if (PHP_VERSION < 80100) { + $p->setAccessible(true); + } $this->assertEmpty($p->getValue($pimple)); $p = new \ReflectionProperty($pimple, 'factories'); - $p->setAccessible(true); + if (PHP_VERSION < 80100) { + $p->setAccessible(true); + } $this->assertCount(0, $p->getValue($pimple)); }