Skip to content

Commit e51512d

Browse files
committed
minor #20147 [Serializer] add nullable format to defaultContext circularReference handler to prevent normalize error (eltharin)
This PR was submitted for the 7.2 branch but it was merged into the 6.4 branch instead. Discussion ---------- [Serializer] add nullable format to defaultContext circularReference handler to prevent normalize error add nullable $format parameter if this defaultContext is used with $serializer->normalize where $format can be nullable. compress arguments with only seventh set. Commits ------- cba78d5 just nullable
2 parents 04b9a92 + cba78d5 commit e51512d

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
@@ -1500,7 +1500,7 @@ having unique identifiers::
15001500

15011501
$encoder = new JsonEncoder();
15021502
$defaultContext = [
1503-
AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER => function (object $object, string $format, array $context): string {
1503+
AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER => function (object $object, ?string $format, array $context): string {
15041504
return $object->getName();
15051505
},
15061506
];

0 commit comments

Comments
 (0)