8000 Minor tweaks · symfony/symfony-docs@2ce1139 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ce1139

Browse files
committed
Minor tweaks
1 parent ec06cc7 commit 2ce1139

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

components/serializer.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -925,18 +925,19 @@ reference. Its default value is ``1``.
925925
.. deprecated:: 4.2
926926

927927
The :method:`Symfony\\Component\\Serializer\\Normalizer\\AbstractNormalizer::setCircularReferenceHandler`
928-
method is deprecated since Symfony 4.2, use the "circular_reference_handler" key of the context instead.
928+
method is deprecated since Symfony 4.2. Use the ``circular_reference_handler``
929+
key of the context instead.
929930

930931
Instead of throwing an exception, circular references can also be handled
931932
by custom callables. This is especially useful when serializing entities
932933
having unique identifiers::
933934

934935
$encoder = new JsonEncoder();
935936
$defaultContext = [
936-
AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER => function ($object, $format, $context) {
937-
return $object->getName();
938-
}
939-
];
937+
AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER => function ($object, $format, $context) {
938+
return $object->getName();
939+
},
940+
];
940941
$normalizer = new ObjectNormalizer(null, null, null, null, null, null, $defaultContext);
941942

942943
$serializer = new Serializer([$normalizer], [$encoder]);

0 commit comments

Comments
 (0)
0