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-p9.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