Skip to content

Commit b80e21d

Browse files
committed
minor #17151 [Serializer] Add return hint (mohamedGasmii)
This PR was merged into the 6.0 branch. Discussion ---------- [Serializer] Add return hint Return hint in NameConverterInterface added in V6.0 <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Commits ------- dfbda13 [Serializer] Add return hint
2 parents f781797 + dfbda13 commit b80e21d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/serializer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,12 +588,12 @@ A custom name converter can handle such cases::
588588

589589
class OrgPrefixNameConverter implements NameConverterInterface
590590
{
591-
public function normalize(string $propertyName)
591+
public function normalize(string $propertyName): string
592592
{
593593
return 'org_'.$propertyName;
594594
}
595595

596-
public function denormalize(string $propertyName)
596+
public function denormalize(string $propertyName): string
597597
{
598598
// removes 'org_' prefix
599599
return 'org_' === substr($propertyName, 0, 4) ? substr($propertyName, 4) : $propertyName;

0 commit comments

Comments
 (0)