Skip to content

Commit 6595d11

Browse files
committed
minor #11887 Update serializer.rst (TakTaki)
This PR was merged into the 4.2 branch. Discussion ---------- Update serializer.rst Commits ------- 6ea286d Update serializer.rst
2 parents b021292 + 6ea286d commit 6595d11

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)