Skip to content

Commit c58aea4

Browse files
thibaut22200javiereguiluz
authored andcommitted
Fix #20080
1 parent 1666a1c commit c58aea4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/serializer.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -799,8 +799,8 @@ When serializing, you can set a callback to format a specific object property::
799799
$encoder = new JsonEncoder();
800800

801801
// all callback parameters are optional (you can omit the ones you don't use)
802-
$dateCallback = function ($innerObject, $outerObject, string $attributeName, ?string $format = null, array $context = []) {
803-
return $innerObject instanceof \DateTime ? $innerObject->format(\DateTime::ATOM) : '';
802+
$dateCallback = function ($attributeValue, $object, string $attributeName, ?string $format = null, array $context = []) {
803+
return $attributeValue instanceof \DateTime ? $attributeValue->format(\DateTime::ATOM) : '';
804804
};
805805

806806
$defaultContext = [

0 commit comments

Comments
 (0)