Code Duplication    Length = 5-5 lines in 2 locations

lib/Caxy/HtmlDiff/HtmlDiff.php 2 locations

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