Skip to content

Commit 56793fa

Browse files
committed
fix(reflection): ReflectionMethod::setAccessible is noop since 8.1
Signed-off-by: Joas Schilling <[email protected]>
1 parent 6bc73b0 commit 56793fa

File tree

3 files changed

+0
-8
lines changed

3 files changed

+0
-8
lines changed

apps/files_sharing/tests/SharedMountTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ public function testShareMountOverShare(): void {
375375
$mountProvider = Server::get(MountProvider::class);
376376
$reflectionClass = new \ReflectionClass($mountProvider);
377377
$reflectionCacheFactory = $reflectionClass->getProperty('cacheFactory');
378-
$reflectionCacheFactory->setAccessible(true);
379378
$reflectionCacheFactory->setValue($mountProvider, $cacheFactory);
380379

381380
// share to user

tests/lib/HelperStorageTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,12 @@ public function testGetStorageInfo(): void {
102102
private function getIncludeExternalStorage(): bool {
103103
$class = new \ReflectionClass(\OC_Helper::class);
104104
$prop = $class->getProperty('quotaIncludeExternalStorage');
105-
$prop->setAccessible(true);
106105
return $prop->getValue(null) ?? false;
107106
}
108107

109108
private function setIncludeExternalStorage(bool $include) {
110109
$class = new \ReflectionClass(\OC_Helper::class);
111110
$prop = $class->getProperty('quotaIncludeExternalStorage');
112-
$prop->setAccessible(true);
113111
$prop->setValue(null, $include);
114112
}
115113

tests/lib/TestCase.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,10 @@ protected static function invokePrivate($object, $methodName, array $parameters
248248

249249
if ($reflection->hasMethod($methodName)) {
250250
$method = $reflection->getMethod($methodName);
251-
252-
$method->setAccessible(true);
253-
254251
return $method->invokeArgs($object, $parameters);
255252
} elseif ($reflection->hasProperty($methodName)) {
256253
$property = $reflection->getProperty($methodName);
257254

258-
$property->setAccessible(true);
259-
260255
if (!empty($parameters)) {
261256
if ($property->isStatic()) {
262257
$property->setValue(null, array_pop($parameters));

0 commit comments

Comments
 (0)