Code Duplication    Length = 25-25 lines in 2 locations

classes/external/php/yui-php-cssmin-2.4.8-4_fgo.php 1 location

@@ 746-770 (lines=25) @@
743
     * @param int|bool $end index (optional)
744
     * @return string
745
     */
746
    private function str_slice($str, $start = 0, $end = FALSE)
747
    {
748
        if ($end !== FALSE && ($start < 0 || $end <= 0)) {
749
            $max = strlen($str);
750
751
            if ($start < 0) {
752
                if (($start = $max + $start) < 0) {
753
                    return '';
754
                }
755
            }
756
757
            if ($end < 0) {
758
                if (($end = $max + $end) < 0) {
759
                    return '';
760
                }
761
            }
762
763
            if ($end <= $start) {
764
                return '';
765
            }
766
        }
767
768
        $slice = ($end === FALSE) ? substr($str, $start) : substr($str, $start, $end - $start);
769
        return ($slice === FALSE) ? '' : $slice;
770
    }
771
772
    /**
773
     * Convert strings like "64M" or "30" to int values

classes/external/php/yui-php-cssmin-2.4.8-p10/cssmin.php 1 location

@@ 1087-1111 (lines=25) @@
1084
     * @param int|bool $end index (optional)
1085
     * @return string
1086
     */
1087
    private function strSlice($str, $start = 0, $end = false)
1088
    {
1089
        if ($end !== false && ($start < 0 || $end <= 0)) {
1090
            $max = strlen($str);
1091
1092
            if ($start < 0) {
1093
                if (($start = $max + $start) < 0) {
1094
                    return '';
1095
                }
1096
            }
1097
1098
            if ($end < 0) {
1099
                if (($end = $max + $end) < 0) {
1100
                    return '';
1101
                }
1102
            }
1103
1104
            if ($end <= $start) {
1105
                return '';
1106
            }
1107
        }
1108
1109
        $slice = ($end === false) ? substr($str, $start) : substr($str, $start, $end - $start);
1110
        return ($slice === false) ? '' : $slice;
1111
    }
1112
}
1113