Skip to content

Commit 0e1ce47

Browse files
committed
Merge branch '7.1' into 7.2
* 7.1: Fix #20080
2 parents 03713d5 + b6ed5b3 commit 0e1ce47

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

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

764764
$defaultContext = [

0 commit comments

Comments
 (0)