ReflectionProperty in ORM si deprecated since 3.5: doctrine/orm#12083
The replacement is PropertyAccessor, which is available since 3.4: doctrine/orm#11659
PropertyAccessor has setValue and getValue methods, which should be sufficient for all uses in this library. I performaed a quick scan of the codebase and found only ->setAccessible(true) as an other method called onto ReflectionProperty (which are obtained via ClassMetaData::getReflectionProperty).
Would it be acceptable to create a small static wrapper like this?
function getProperty(ClassMetadata $meta): ReflectionProperty|PropertyAccessor|null
{
if (method_exists(ClassMetadata::class, 'getPropertyAccessor')) {
return $meta->getPropertyAccessor();
}
return $meta->getReflectionProperty();
}
...and use it everywhere in the codebase to solve this issue?
ReflectionPropertyin ORM si deprecated since 3.5: doctrine/orm#12083The replacement is
PropertyAccessor, which is available since 3.4: doctrine/orm#11659PropertyAccessorhassetValueandgetValuemethods, which should be sufficient for all uses in this library. I performaed a quick scan of the codebase and found only->setAccessible(true)as an other method called ontoReflectionProperty(which are obtained viaClassMetaData::getReflectionProperty).Would it be acceptable to create a small static wrapper like this?
...and use it everywhere in the codebase to solve this issue?