Closed
Description
Symfony IsVersions(s) Affected
All
Description
I'm trying to use a custom Read/Write Info Extractor within the PropertyAccessor.
// CustomReadExtractor.php
class CustomReadExtractor implements PropertyReadInfoExtractorInterface {
public function getReadInfo(string $class, string $property, array $context = []): ?PropertyReadInfo;
{
//custom logic
}
}
// example usage
$extractor = new CustomReadExtractor();
(new PropertyAccessorBuilder)->setReadInfoExtractor($extractor);
Howevery, the class PropertyReadInfo
is marked as @internal
in it's docblock, causing the IDE and PHPStan to complain about usage of internal members.
I assume that creating a custom extractor is something that should be supported, as the documentation states [...] While you can create your own extractors, the following are already available to cover most use-cases
The same problem is with PropertyWriteInfo
while implementing a custom class for PropertyWriteExtractorInterface
.
Is it a wanted limitation or something we can fix?
Example
The new PropertyReadInfo
and PropertyWriteInfo
should not be marked as @internal
Before:
/**
* The property read info tells how a property can be read.
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*
* @internal
*/
final class PropertyReadInfo
{
}
After
/**
* The property read info tells how a property can be read.
*
* @author Joel Wurtz <jwurtz@jolicode.com>
*
*/
final class PropertyReadInfo
{