Code Duplication    Length = 15-15 lines in 2 locations

lib/Ajde/Component/Form/UploadHelper.php 1 location

@@ 118-132 (lines=15) @@
115
        }
116
    }
117
118
    private function toBytes($str)
119
    {
120
        $val = trim($str);
121
        $last = strtolower($str[strlen($str) - 1]);
122
        switch ($last) {
123
            case 'g':
124
                $val *= 1024;
125
            case 'm':
126
                $val *= 1024;
127
            case 'k':
128
                $val *= 1024;
129
        }
130
131
        return $val;
132
    }
133
134
    /**
135
     * Returns array('success'=>true) or array('error'=>'error message').

lib/Ajde/Component/String.php 1 location

@@ 536-550 (lines=15) @@
533
        }
534
    }
535
536
    public static function toBytes($str)
537
    {
538
        $val = trim($str);
539
        $last = strtolower($str[strlen($str) - 1]);
540
        switch ($last) {
541
            case 'g':
542
                $val *= 1024;
543
            case 'm':
544
                $val *= 1024;
545
            case 'k':
546
                $val *= 1024;
547
        }
548
549
        return $val;
550
    }
551
552
    public static function toSnakeCase($camelCase)
553
    {