function MetadataAwareNameConverter::denormalize
Overrides AdvancedNameConverterInterface::denormalize
File
-
vendor/
symfony/ serializer/ NameConverter/ MetadataAwareNameConverter.php, line 57
Class
- MetadataAwareNameConverter
- @author Fabien Bourigault <bourigaultfabien@gmail.com>
Namespace
Symfony\Component\Serializer\NameConverterCode
public function denormalize(string $propertyName, ?string $class = null, ?string $format = null, array $context = []) : string {
if (null === $class) {
return $this->denormalizeFallback($propertyName, $class, $format, $context);
}
$cacheKey = $this->getCacheKey($class, $context);
if (!\array_key_exists($cacheKey, self::$denormalizeCache) || !\array_key_exists($propertyName, self::$denormalizeCache[$cacheKey])) {
self::$denormalizeCache[$cacheKey][$propertyName] = $this->getCacheValueForDenormalization($propertyName, $class, $context);
}
return self::$denormalizeCache[$cacheKey][$propertyName] ?? $this->denormalizeFallback($propertyName, $class, $format, $context);
}