Skip to content

Commit b6ed5b3

Browse files
committed
Merge branch '6.4' into 7.1
* 6.4: Fix #20080
2 parents cba8568 + a75ae9a commit b6ed5b3

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
@@ -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)