diff --git a/components/serializer.rst b/components/serializer.rst index 092b8a52c28..3b5370cb5cb 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -588,12 +588,12 @@ A custom name converter can handle such cases:: class OrgPrefixNameConverter implements NameConverterInterface { - public function normalize(string $propertyName) + public function normalize(string $propertyName): string { return 'org_'.$propertyName; } - public function denormalize(string $propertyName) + public function denormalize(string $propertyName): string { // removes 'org_' prefix return 'org_' === substr($propertyName, 0, 4) ? substr($propertyName, 4) : $propertyName;