10000 Fixes var name in callback · symfony/symfony-docs@48b1fec · GitHub
[go: up one dir, main page]

Skip to content

Commit 48b1fec

Browse files
authored
Fixes var name in callback
1 parent e350b3e commit 48b1fec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/serializer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ When serializing, you can set a callback to format a specific object property::
629629

630630
// all callback parameters are optional (you can omit the ones you don't use)
631631
$callback = function ($innerObject, $outerObject, string $attributeName, string $format = null, array $context = array()) {
632-
return $dateTime instanceof \DateTime ? $dateTime->format(\DateTime::ISO8601) : '';
632+
return $innerObject instanceof \DateTime ? $innerObject->format(\DateTime::ISO8601) : '';
633633
};
634634

635635
$normalizer->setCallbacks(array('createdAt' => $callback));

0 commit comments

Comments
 (0)
0