Skip to content

Commit 3cf9474

Browse files
committed
Fix #20080
1 parent dae3dfe commit 3cf9474

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/serializer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,8 +756,8 @@ When serializing, you can set a callback to format a specific object property::
756756
$encoder = new JsonEncoder();
757757

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

763763
$defaultContext = [

0 commit comments

Comments
 (0)