Code Duplication    Length = 6-8 lines in 2 locations

src/PhpQueryObject.php 2 locations

@@ 2687-2694 (lines=8) @@
2684
                if ($target instanceof self) {
2685
                    if ($to) {
2686
                        $insertTo = $target->elements;
2687
                        if ($this->documentFragment && $this->stackIsRoot())
2688
                            // get all body children
2689
                            //							$loop = $this->find('body > *')->elements;
2690
                            // TODO test it, test it hard...
2691
                            //							$loop = $this->newInstance($this->root)->find('> *')->elements;
2692
                            $loop = $this->root->childNodes;
2693
                        else
2694
                            $loop = $this->elements;
2695
                        // import nodes if needed
2696
                        $insertFrom = $this->getDocumentID() == $target->getDocumentID() ? $loop
2697
                            : $target->documentWrapper->import($loop);
@@ 2719-2724 (lines=6) @@
2716
                        $insertTo = array(
2717
                            $target
2718
                        );
2719
                        if ($this->documentFragment && $this->stackIsRoot())
2720
                            // get all body children
2721
                            $loop = $this->root->childNodes;
2722
                        //							$loop = $this->find('body > *')->elements;
2723
                        else
2724
                            $loop = $this->elements;
2725
                        foreach ($loop as $fromNode)
2726
                            // import nodes if needed
2727
                            $insertFrom[] = !$fromNode->ownerDocument->isSameNode(