From c58aea4dd09030c98d26ef74f5cd75b47d2f5400 Mon Sep 17 00:00:00 2001 From: Thibaut THOUEMENT Date: Fri, 23 Aug 2024 17:37:54 +0200 Subject: [PATCH] Fix #20080 --- components/serializer.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/serializer.rst b/components/serializer.rst index 43bcc240e57..0da80f10e0e 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -799,8 +799,8 @@ When serializing, you can set a callback to format a specific object property:: $encoder = new JsonEncoder(); // all callback parameters are optional (you can omit the ones you don't use) - $dateCallback = function ($innerObject, $outerObject, string $attributeName, ?string $format = null, array $context = []) { - return $innerObject instanceof \DateTime ? $innerObject->format(\DateTime::ATOM) : ''; + $dateCallback = function ($attributeValue, $object, string $attributeName, ?string $format = null, array $context = []) { + return $attributeValue instanceof \DateTime ? $attributeValue->format(\DateTime::ATOM) : ''; }; $defaultContext = [