Code Duplication    Length = 5-5 lines in 2 locations

lib/Caxy/HtmlDiff/HtmlDiff.php 2 locations

@@ 459-463 (lines=5) @@
456
        }
457
        if ($indexOfFirstTag !== null) {
458
            $items = array();
459
            foreach ($words as $pos => $s) {
460
                if ($pos >= 0 && $pos < $indexOfFirstTag) {
461
                    $items[] = $s;
462
                }
463
            }
464
            if ($indexOfFirstTag > 0) {
465
                array_splice( $words, 0, $indexOfFirstTag );
466
            }
@@ 471-475 (lines=5) @@
468
            return $items;
469
        } else {
470
            $items = array();
471
            foreach ($words as $pos => $s) {
472
                if ( $pos >= 0 && $pos <= count( $words ) ) {
473
                    $items[] = $s;
474
                }
475
            }
476
            array_splice( $words, 0, count( $words ) );
477
478
            return $items;