10000 [Serializer] Add XmlEncoder:: defaults directly to argument, per @ost… · symfony/symfony@dec179a · GitHub
[go: up one dir, main page]

Skip to content

Commit dec179a

Browse files
author
James Sansbury
committed
[Serializer] Add XmlEncoder:: defaults directly to argument, per @ostrolucky.
1 parent 3856734 commit dec179a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Serializer/Encoder/XmlEncoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ class XmlEncoder implements EncoderInterface, DecoderInterface, NormalizationAwa
4545
* @param int|null $loadOptions A bit field of LIBXML_* constants
4646
* @param int[] $ignoredNodeTypes an array of ignored XML node types, each one of the DOM Predefined XML_* Constants
4747
*/
48-
public function __construct(string $rootNodeName = 'response', int $loadOptions = null, array $ignoredNodeTypes = null)
48+
public function __construct(string $rootNodeName = 'response', int $loadOptions = null, array $ignoredNodeTypes = array(XML_PI_NODE, XML_COMMENT_NODE))
4949
{
5050
$this->rootNodeName = $rootNodeName;
5151
$this->loadOptions = null !== $loadOptions ? $loadOptions : LIBXML_NONET | LIBXML_NOBLANKS;
52-
$this->ignoredNodeTypes = !empty($ignoredNodeTypes) ? $ignoredNodeTypes : array(XML_PI_NODE, XML_COMMENT_NODE);
52+
$this->ignoredNodeTypes = $ignoredNodeTypes;
5353
}
5454

5555
/**

0 commit comments

Comments
 (0)
0