Code Duplication    Length = 4-5 lines in 5 locations

lib/elFinder.class.php 5 locations

@@ 2099-2102 (lines=4) @@
2096
        $target = $args['target'];
2097
        $name = $args['name'];
2098
2099
        if (($volume = $this->volume($target)) == false
2100
        || ($rm = $volume->file($target)) == false) {
2101
            return ['error' => $this->error(self::ERROR_RENAME, '#'.$target, self::ERROR_FILE_NOT_FOUND)];
2102
        }
2103
        $rm['realpath'] = $volume->realpath($target);
2104
2105
        if ($this->itemLocked($target)) {
@@ 2132-2136 (lines=5) @@
2129
        foreach ($targets as $target) {
2130
            self::extendTimeLimit();
2131
2132
            if (($volume = $this->volume($target)) == false
2133
            || ($src = $volume->file($target)) == false) {
2134
                $result['warning'] = $this->error(self::ERROR_COPY, '#'.$target, self::ERROR_FILE_NOT_FOUND);
2135
                break;
2136
            }
2137
2138
            if (($file = $volume->duplicate($target, $suffix)) == false) {
2139
                $result['warning'] = $this->error($volume->error());
@@ 3088-3091 (lines=4) @@
3085
    {
3086
        $target = $args['target'];
3087
3088
        if (($volume = $this->volume($target)) == false
3089
        || ($file = $volume->file($target)) == false) {
3090
            return ['error' => $this->error(self::ERROR_SAVE, '#'.$target, self::ERROR_FILE_NOT_FOUND)];
3091
        }
3092
3093
        $this->itemLock($target);
3094
@@ 3134-3137 (lines=4) @@
3131
        $error = [self::ERROR_EXTRACT, '#'.$target];
3132
        $makedir = isset($args['makedir']) ? (bool) $args['makedir'] : null;
3133
3134
        if (($volume = $this->volume($target)) == false
3135
        || ($file = $volume->file($target)) == false) {
3136
            return ['error' => $this->error(self::ERROR_EXTRACT, '#'.$target, self::ERROR_FILE_NOT_FOUND)];
3137
        }
3138
3139
        $res = [];
3140
        if ($file = $volume->extract($target, $makedir)) {
@@ 3317-3320 (lines=4) @@
3314
        $degree = (int) $args['degree'];
3315
        $quality = (int) $args['quality'];
3316
3317
        if (($volume = $this->volume($target)) == false
3318
        || ($file = $volume->file($target)) == false) {
3319
            return ['error' => $this->error(self::ERROR_RESIZE, '#'.$target, self::ERROR_FILE_NOT_FOUND)];
3320
        }
3321
3322
        if ($mode !== 'rotate' && ($width < 1 || $height < 1)) {
3323
            return ['error' => $this->error(self::ERROR_RESIZESIZE)];