Code Duplication    Length = 16-16 lines in 2 locations

lib/plugins/Normalizer/plugin.php 1 location

@@ 104-119 (lines=16) @@
101
        return true;
102
    }
103
104
    public function cmdPostprocess($cmd, &$result, $args, $elfinder)
105
    {
106
        if ($cmd === 'ls') {
107
            if (! empty($result['list']) && ! empty($this->replaced['ls'])) {
108
                foreach ($result['list'] as $hash => $name) {
109
                    if ($keys = array_keys($this->replaced['ls'], $name)) {
110
                        if (count($keys) === 1) {
111
                            $result['list'][$hash] = $keys[0];
112
                        } else {
113
                            $result['list'][$hash] = $keys;
114
                        }
115
                    }
116
                }
117
            }
118
        }
119
    }
120
121
    // NOTE: $thash is directory hash so it unneed to process at here
122
    public function onUpLoadPreSave(&$thash, &$name, $src, $elfinder, $volume)

lib/plugins/Sanitizer/plugin.php 1 location

@@ 91-106 (lines=16) @@
88
        return true;
89
    }
90
91
    public function cmdPostprocess($cmd, &$result, $args, $elfinder)
92
    {
93
        if ($cmd === 'ls') {
94
            if (! empty($result['list']) && ! empty($this->replaced['ls'])) {
95
                foreach ($result['list'] as $hash => $name) {
96
                    if ($keys = array_keys($this->replaced['ls'], $name)) {
97
                        if (count($keys) === 1) {
98
                            $result['list'][$hash] = $keys[0];
99
                        } else {
100
                            $result['list'][$hash] = $keys;
101
                        }
102
                    }
103
                }
104
            }
105
        }
106
    }
107
108
    // NOTE: $thash is directory hash so it unneed to process at here
109
    public function onUpLoadPreSave(&$thash, &$name, $src, $elfinder, $volume)