Code Duplication    Length = 5-5 lines in 2 locations

lib/Caxy/HtmlDiff/HtmlDiff.php 2 locations

@@ 645-649 (lines=5) @@
642
        }
643
        if ($indexOfFirstTag !== null) {
644
            $items = array();
645
            foreach ($words as $pos => $s) {
646
                if ($pos >= 0 && $pos < $indexOfFirstTag) {
647
                    $items[] = $s;
648
                }
649
            }
650
            if ($indexOfFirstTag > 0) {
651
                array_splice($words, 0, $indexOfFirstTag);
652
            }
@@ 657-661 (lines=5) @@
654
            return $items;
655
        } else {
656
            $items = array();
657
            foreach ($words as $pos => $s) {
658
                if ($pos >= 0 && $pos <= count($words)) {
659
                    $items[] = $s;
660
                }
661
            }
662
            array_splice($words, 0, count($words));
663
664
            return $items;