8000 Update serializer.rst · symfony/symfony-docs@711d27c · GitHub
[go: up one dir, main page]

Skip to content

Commit 711d27c

Browse files
hbgamraOskarStark
authored andcommitted
Update serializer.rst
use php8 functions to manipulate string
1 parent ac59689 commit 711d27c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/serializer.rst

Lines changed: 1 addition & 1 deletion
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)
0