/**
* Update the attributes of a child node
*
* @param \SimpleXMLElement $source The source element on which to append the attributes
* @param \SimpleXMLElement $new The new element to append
*
* @return void
*
* @since 1.7.0
*/
protected static function mergeNode(\SimpleXMLElement $source, \SimpleXMLElement $new)
{
// Update the attributes of the child node.
foreach ($new->attributes() as $name => $value) {
if (isset($source[$name])) {
$source[$name] = (string) $value;
} else {
$source->addAttribute($name, $value);
}
}
}