Skip to content

Commit 2ac4381

Browse files
committed
fix php 8.5 deprecations - Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect
As of PHP 8.1.0, calling this method has no effect; all properties are accessible by default. @see https://www.php.net/manual/en/reflectionproperty.setaccessible.php @see https://wiki.php.net/rfc/deprecations_php_8_5#extreflection_deprecations
1 parent 90eddbc commit 2ac4381

File tree

3 files changed

+0
-4
lines changed

3 files changed

+0
-4
lines changed

src/Doctrine/Orm/Tests/Extension/PaginationExtensionTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ public function testGetResultWithFetchJoinCollection(bool $paginationFetchJoinCo
387387
$this->assertInstanceOf(PaginatorInterface::class, $result);
388388

389389
$doctrinePaginatorReflectionProperty = new \ReflectionProperty(AbstractPaginator::class, 'paginator');
390-
$doctrinePaginatorReflectionProperty->setAccessible(true);
391390

392391
$doctrinePaginator = $doctrinePaginatorReflectionProperty->getValue($result);
393392
$this->assertSame($expected, $doctrinePaginator->getFetchJoinCollection());
@@ -435,7 +434,6 @@ public function testGetResultWithUseOutputWalkers(bool $paginationUseOutputWalke
435434
$this->assertInstanceOf(PaginatorInterface::class, $result);
436435

437436
$doctrinePaginatorReflectionProperty = new \ReflectionProperty(AbstractPaginator::class, 'paginator');
438-
$doctrinePaginatorReflectionProperty->setAccessible(true);
439437

440438
$doctrinePaginator = $doctrinePaginatorReflectionProperty->getValue($result);
441439
$this->assertSame($expected, $doctrinePaginator->getUseOutputWalkers());

src/Hal/Tests/Serializer/ItemNormalizerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ public function testMaxDepth(): void
295295
{
296296
$setId = function (MaxDepthDummy $dummy, int $id): void {
297297
$prop = new \ReflectionProperty($dummy, 'id');
298-
$prop->setAccessible(true);
299298
$prop->setValue($dummy, $id);
300299
};
301300

src/Metadata/Extractor/PhpFileResourceExtractor.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ protected function extractPath(string $path): void
3838
$resourceReflection = new \ReflectionClass($resource);
3939

4040
foreach ($resourceReflection->getProperties() as $property) {
41-
$property->setAccessible(true);
4241
$resolvedValue = $this->resolve($property->getValue($resource));
4342
$property->setValue($resource, $resolvedValue);
4443
}

0 commit comments

Comments
 (0)