diff --git a/components/serializer.rst b/components/serializer.rst index 27d503e49ed..3a63fffe024 100644 --- a/components/serializer.rst +++ b/components/serializer.rst @@ -1108,8 +1108,10 @@ always as a collection. behavior can be changed with the optional context key ``XmlEncoder::DECODER_IGNORED_NODE_TYPES``. Data with ``#comment`` keys are encoded to XML comments by default. This can be - changed with the optional ``$encoderIgnoredNodeTypes`` argument of the - ``XmlEncoder`` class constructor. + changed by adding the ``\XML_COMMENT_NODE`` option to the ``XmlEncoder::ENCODER_IGNORED_NODE_TYPES`` key of the ``$defaultContext`` of the + ``XmlEncoder`` class constructor or directly to the encode() method's $context argument. + + $xmlEncoder->encode($array, 'xml', [XmlEncoder::ENCODER_IGNORED_NODE_TYPES => [\XML_COMMENT_NODE]]); The ``XmlEncoder`` Context Options ..................................