Skip to content

Commit d114e1f

Browse files
committed
minor #19572 Update serializer.rst (hbgamra)
This PR was submitted for the 7.0 branch but it was merged into the 5.4 branch instead. Discussion ---------- Update serializer.rst use php8 functions to manipulate string <!-- 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 `7.x` for features of unreleased versions). --> Commits ------- 711d27c Update serializer.rst
2 parents ac59689 + 711d27c commit d114e1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/serializer.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ A custom name converter can handle such cases::
606606
public function denormalize(string $propertyName)
607607
{
608608
// removes 'org_' prefix
609-
return 'org_' === substr($propertyName, 0, 4) ? substr($propertyName, 4) : $propertyName;
609+
return str_starts_with($propertyName, 'org_') ? substr($propertyName, 4) : $propertyName;
610610
}
611611
}
612612

0 commit comments

Comments
 (0)