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:
Eloy Lafuente (stronk7) 2024-03-10 18:11:25 +01:00
parent 38a3310c92
commit 361dfe8145
No known key found for this signature in database
GPG key ID: 53487A05E6228820
134 changed files with 7 additions and 383 deletions

View file

@ -281,7 +281,6 @@ class command_test extends \advanced_testcase {
);
$execute = new ReflectionMethod($instance, 'execute');
$execute->setAccessible(true);
$execute->invoke($instance, $command);
}

View file

@ -447,7 +447,6 @@ class matrix_client_test extends \advanced_testcase {
$rc = new \ReflectionClass($instance);
$rcm = $rc->getMethod('execute');
$rcm->setAccessible(true);
$result = $rcm->invoke($instance, $command);
$this->assertEquals(200, $result->getStatusCode());