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

Skip to content

Commit c06b1ce

Browse files
authored
Update serializer.rst
use php8 functions to manipulate string
1 parent 9b2310a commit c06b1ce

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
@@ -556,7 +556,7 @@ A custom name converter can handle such cases::
556556
public function denormalize(string $propertyName): string
557557
{
558558
// removes 'org_' prefix
559-
return 'org_' === substr($propertyName, 0, 4) ? substr($propertyName, 4) : $propertyName;
559+
return str_starts_with($propertyName, 'org_') ? substr($propertyName, 4) : $propertyName;
560560
}
561561
}
562562

0 commit comments

Comments
 (0)
0