Code Duplication    Length = 4-4 lines in 2 locations

src/View/Helper/LessHelper.php 2 locations

@@ 173-176 (lines=4) @@
170
        $plgPaths = Configure::read('App.paths.plugins');
171
        foreach ($plgPaths as $plgPath) {
172
            $plgPath = FS::clean($plgPath, '/');
173
            if (preg_match('(' . quotemeta($plgPath) . ')', $path)) {
174
                $path = str_replace($plgPath, '', $path);
175
                return [true, $path];
176
            }
177
        }
178
179
        foreach (Configure::read('plugins') as $name => $plgPath) {
@@ 181-184 (lines=4) @@
178
179
        foreach (Configure::read('plugins') as $name => $plgPath) {
180
            $plgPath = FS::clean($plgPath, '/');
181
            if (preg_match('(' . quotemeta($plgPath) . ')', $path)) {
182
                $path = Str::low($name) . '/' . str_replace($plgPath, '', $path);
183
                return [true, $path];
184
            }
185
        }
186
187
        return [$isPlugin, $path];