private static array
$attributesMetadataCache =
[];
public function __construct( private readonly ClassMetadataFactoryInterface
$metadataFactory,
private readonly ?NameConverterInterface
$fallbackNameConverter = null,
) { } public function normalize(string
$propertyName, string
$class = null, string
$format = null, array
$context =
[]): string
{ if (null ===
$class) { return $this->
normalizeFallback($propertyName,
$class,
$format,
$context);
} if (!\
array_key_exists($class, self::
$normalizeCache) || !\
array_key_exists($propertyName, self::
$normalizeCache[$class])) { self::
$normalizeCache[$class][$propertyName] =
$this->
getCacheValueForNormalization($propertyName,
$class);
} return self::
$normalizeCache[$class][$propertyName] ??
$this->
normalizeFallback($propertyName,
$class,
$format,
$context);
} public function denormalize(string
$propertyName, string
$class = null, string
$format = null, array
$context =
[]): string
{