merged branch fabpot/moved_serializer_4 (PR #7292)

This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #7292).

Commits
-------

4ffe234 Fix warning for buildXml method

Discussion
----------

Fix missing argument

This PR was submitted on the symfony/Serializer read-only repository and moved automatically to the main Symfony repository (closes symfony/Serializer#4).

Fix "Warning: Missing argument 3" for XmlEncoder::buildXml() called several times in XmlEncoder::selectNodeType()
This commit is contained in:
Fabien Potencier 2013-03-06 22:43:24 +01:00
commit 95444058fe

View File

@ -287,7 +287,7 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec
*
* @throws UnexpectedValueException
*/
private function buildXml($parentNode, $data, $xmlRootNodeName)
private function buildXml($parentNode, $data, $xmlRootNodeName = null)
{
$append = true;
@ -392,7 +392,7 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec
private function selectNodeType($node, $val)
{
if (is_array($val)) {
return $this->buildXml($node, $val, null);
return $this->buildXml($node, $val);
} elseif ($val instanceof \SimpleXMLElement) {
$child = $this->dom->importNode(dom_import_simplexml($val), true);
$node->appendChild($child);