File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/Symfony/Component/Serializer/Encoder Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -488,6 +488,9 @@ private function selectNodeType(\DOMNode $node, $val)
488488 $ node ->appendChild ($ child );
489489 } elseif ($ val instanceof \Traversable) {
490490 $ this ->buildXml ($ node , $ val );
491+ } elseif ($ val instanceof \DOMNode) {
492+ $ child = $ this ->dom ->importNode ($ val , true );
493+ $ node ->appendChild ($ child );
491494 } elseif (\is_object ($ val )) {
492495 if (null === $ this ->serializer ) {
493496 throw new BadMethodCallException (sprintf ('The serializer needs to be set to allow "%s()" to be used with object data. ' , __METHOD__ ));
@@ -502,9 +505,6 @@ private function selectNodeType(\DOMNode $node, $val)
502505 return $ this ->appendText ($ node , $ val );
503506 } elseif (\is_bool ($ val )) {
504507 return $ this ->appendText ($ node , (int ) $ val );
505- } elseif ($ val instanceof \DOMNode) {
506- $ child = $ this ->dom ->importNode ($ val , true );
507- $ node ->appendChild ($ child );
508508 }
509509
510510 return true ;
You can’t perform that action at this time.
0 commit comments