Skip to content

Commit 002a850

Browse files
authored
Merge pull request #261 from Yoast/feature/fix-runtime-deprecations-php-8.5
PHP 8.5 | Tests: prevent deprecation notice for Reflection*::setAccessible()
2 parents 4313f03 + 5c49998 commit 002a850

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Helpers/AssertAttributeHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ trait AssertAttributeHelper {
4949
public static function getProperty( $objInstance, $propertyName ) {
5050
$reflect = new ReflectionObject( $objInstance );
5151
$property = $reflect->getProperty( $propertyName );
52-
$property->setAccessible( true );
52+
( \PHP_VERSION_ID < 80100 ) && $property->setAccessible( true );
5353

5454
return $property;
5555
}

0 commit comments

Comments
 (0)