MDL-75952 general: Since php81, refection->setAccessible() is no-op
Refereces: - https://wiki.php.net/rfc/make-reflection-setaccessible-no-op - https://www.php.net/manual/en/reflectionproperty.setaccessible.php - https://www.php.net/manual/en/reflectionmethod.setaccessible.php As of PHP 8.1.0, calling this method has no effect; all methods are invokable by default. So, let's remove all uses from core, they are no-op.
This commit is contained in:
@@ -89,7 +89,6 @@ class pgsql_native_moodle_database_test extends \advanced_testcase {
|
||||
global $DB;
|
||||
$reflector = new ReflectionClass($DB);
|
||||
$property = $reflector->getProperty('inorequaluniqueindex');
|
||||
$property->setAccessible(true);
|
||||
return (int) $property->getValue($DB);
|
||||
}
|
||||
|
||||
@@ -390,7 +389,6 @@ class pgsql_native_moodle_database_test extends \advanced_testcase {
|
||||
|
||||
$reflector = new ReflectionClass($db2);
|
||||
$rp = $reflector->getProperty('pgsql');
|
||||
$rp->setAccessible(true);
|
||||
return $rp->getValue($db2);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user