if (!\
is_scalar($data)) { $data =
$this->serializer->
normalize($data,
$format,
$context);
} if (\
is_bool($data)) { $data =
(int) $data;
} $parentNode->
setAttribute($attributeName,
$data);
} elseif ('#' ===
$key) { $append =
$this->
selectNodeType($parentNode,
$data,
$format,
$context);
} elseif ('#comment' ===
$key) { if (!\
in_array(\XML_COMMENT_NODE,
$encoderIgnoredNodeTypes, true
)) { $append =
$this->
appendComment($parentNode,
$data);
} } elseif (\
is_array($data) && false ===
is_numeric($key)) { // Is this array fully numeric keys?
if (ctype_digit(implode('',
array_keys($data)))) { /*
* Create nodes to append to $parentNode based on the $key of this array
* Produces <xml><item>0</item><item>1</item></xml>
* From ["item" => [0,1]];.
*/
foreach ($data as $subData) { $append =
$this->
appendNode($parentNode,
$subData,
$format,
$context,
$key);
}