Skip to content

Commit 6f3c8d4

Browse files
keithbrinkclaude
andcommitted
Remove deprecated ReflectionProperty::setAccessible() calls
setAccessible() has no effect since PHP 8.1 and is deprecated in PHP 8.5. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a677d72 commit 6f3c8d4

File tree

3 files changed

+0
-4
lines changed

3 files changed

+0
-4
lines changed

src/Testing/SimpleHydrator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ private static function hydrateReflection(ReflectionClass $reflection, object $i
2525
{
2626
if ($reflection->hasProperty($field)) {
2727
$property = $reflection->getProperty($field);
28-
$property->setAccessible(true);
2928
$property->setValue($instance, $value);
3029
} else {
3130
$parent = $reflection->getParentClass();

tests/Feature/EntityManagerFactoryTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,8 +695,6 @@ public function testPhpFileCacheCustomPath(): void
695695

696696
$reflectionCache = new ReflectionObject($metadataCache);
697697
$directoryProperty = $reflectionCache->getProperty('directory');
698-
$directoryProperty->setAccessible(true);
699-
700698
$this->assertStringContainsString('tests/cache', $directoryProperty->getValue($metadataCache));
701699
rmdir(__DIR__ . '/../cache/doctrine-cache');
702700
}

tests/Feature/Notifications/NotificationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public function testClassFunctions(): void
4848

4949
$reflection = new ReflectionClass($entity);
5050
$property = $reflection->getProperty('id');
51-
$property->setAccessible(true);
5251
$property->setValue($entity, 1);
5352

5453
$entity->getId();

0 commit comments

Comments
 (0)