Skip to content

Commit 6ea286d

Browse files
authored
Update serializer.rst
1 parent 83d00a7 commit 6ea286d

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
@@ -639,7 +639,7 @@ When serializing, you can set a callback to format a specific object property::
639639
$encoder = new JsonEncoder();
640640

641641
// all callback parameters are optional (you can omit the ones you don't use)
642-
$dateCallback = function ($innerObject, $outerObject, string $attributeName, string $format = null, array $context = []) {
642+
$callback = function ($innerObject, $outerObject, string $attributeName, string $format = null, array $context = []) {
643643
return $innerObject instanceof \DateTime ? $innerObject->format(\DateTime::ISO8601) : '';
644644
};
645645

0 commit comments

Comments
 (0)