From dfbda13342a933a0ad66c91f703d4f86d3cea873 Mon Sep 17 00:00:00 2001 From: mohamed gasmi Date: Wed, 10 Aug 2022 20:56:19 +0200 Subject: [PATCH] [Serializer] Add return hint Return hint in NameConverterInterface added in V6.0 --- components/serializer.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;