function MetadataAwareNameConverter::normalize
Overrides AdvancedNameConverterInterface::normalize
File
-
vendor/
symfony/ serializer/ NameConverter/ MetadataAwareNameConverter.php, line 44
Class
- MetadataAwareNameConverter
- @author Fabien Bourigault <bourigaultfabien@gmail.com>
Namespace
Symfony\Component\Serializer\NameConverterCode
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);
}