Skip to content

Commit 0200298

Browse files
committed
minor #279 PimpleTest: Only call setAccessible on PHP < 8.1 (reedy)
This PR was merged into the main branch. Discussion ---------- 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. and > This function has been DEPRECATED as of PHP 8.5.0. Relying on this function is highly discouraged. Commits ------- 86c553f PimpleTest: Only call setAccessible on PHP < 8.1
2 parents a70f552 + 86c553f commit 0200298

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Pimple/Tests/PimpleTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,15 @@ public function testExtendDoesNotLeakWithFactories()
275275
unset($pimple['foo']);
276276

277277
$p = new \ReflectionProperty($pimple, 'values');
278-
$p->setAccessible(true);
278+
if (PHP_VERSION < 80100) {
279+
$p->setAccessible(true);
280+
}
279281
$this->assertEmpty($p->getValue($pimple));
280282

281283
$p = new \ReflectionProperty($pimple, 'factories');
282-
$p->setAccessible(true);
284+
if (PHP_VERSION < 80100) {
285+
$p->setAccessible(true);
286+
}
283287
$this->assertCount(0, $p->getValue($pimple));
284288
}
285289

0 commit comments

Comments
 (0)