diff --git a/components/serializer.rst b/components/serializer.rst index 0e8af7814f3..43ed69f3307 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -1500,7 +1500,7 @@ having unique identifiers:: $encoder = new JsonEncoder(); $defaultContext = [ - AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER => function (object $object, string $format, array $context): string { + AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER => function (object $object, ?string $format, array $context): string { return $object->getName(); }, ];