Skip to content

Commit 2696e9e

Browse files
committed
minor #1726 Do not call Reflection*::setAccessible() (W0rma)
This PR was merged into the 1.x branch. Discussion ---------- Do not call Reflection*::setAccessible() > As of PHP 8.1.0, calling this method has no effect; all methods are invokable by default. (https://www.php.net/manual/en/reflectionmethod.setaccessible.php and https://www.php.net/manual/en/reflectionproperty.setaccessible.php). There're even plans to deprecate the method in PHP 8.5: https://wiki.php.net/rfc/deprecations_php_8_5#extreflection_deprecations Commits ------- c55d785 Remove noop setAccessible() call
2 parents d3e8169 + c55d785 commit 2696e9e

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/Doctrine/DoctrineHelper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ public function getMetadata(?string $classOrNamespace = null, bool $disconnected
155155
if ($attributeDriver instanceof AttributeDriver) {
156156
$classNames = (new \ReflectionClass(AttributeDriver::class))->getProperty('classNames');
157157

158-
$classNames->setAccessible(true);
159158
$classNames->setValue($attributeDriver, null);
160159
}
161160
}

0 commit comments

Comments
 (0)