FluentDOM\Node\MutationMacro::add PHP Method

add() private static method

private static add ( DOMDocumentFragment $target, DOMNode $node )
$target DOMDocumentFragment
$node DOMNode
    private static function add($target, $node)
    {
        if ($node instanceof \DOMDocument) {
            if ($node->documentElement instanceof \DOMElement) {
                $target->appendChild($target->ownerDocument->importNode($node->documentElement, TRUE));
            }
        } elseif ($node->ownerDocument !== $target->ownerDocument) {
            $target->appendChild($target->ownerDocument->importNode($node, TRUE));
        } else {
            $target->appendChild($node->cloneNode(TRUE));
        }
    }