Code Duplication    Length = 4-6 lines in 4 locations

src/Eccube/Util/Cache.php 3 locations

@@ 54-59 (lines=6) @@
51
        if ($isAll) {
52
            $finder = Finder::create()->in($cacheDir)->notName('.gitkeep');
53
            $filesystem->remove($finder);
54
        } elseif ($isTwig) {
55
            if (is_dir($cacheDir.'/twig')) {
56
                $finder = Finder::create()->in($cacheDir.'/twig');
57
                $filesystem->remove($finder);
58
            }
59
        } else {
60
            if (is_dir($cacheDir.'/doctrine')) {
61
                $finder = Finder::create()->in($cacheDir.'/doctrine');
62
                $filesystem->remove($finder);
@@ 60-63 (lines=4) @@
57
                $filesystem->remove($finder);
58
            }
59
        } else {
60
            if (is_dir($cacheDir.'/doctrine')) {
61
                $finder = Finder::create()->in($cacheDir.'/doctrine');
62
                $filesystem->remove($finder);
63
            }
64
            if (is_dir($cacheDir.'/profiler')) {
65
                $finder = Finder::create()->in($cacheDir.'/profiler');
66
                $filesystem->remove($finder);
@@ 64-67 (lines=4) @@
61
                $finder = Finder::create()->in($cacheDir.'/doctrine');
62
                $filesystem->remove($finder);
63
            }
64
            if (is_dir($cacheDir.'/profiler')) {
65
                $finder = Finder::create()->in($cacheDir.'/profiler');
66
                $filesystem->remove($finder);
67
            }
68
            if (is_dir($cacheDir.'/twig')) {
69
                $finder = Finder::create()->in($cacheDir.'/twig');
70
                $filesystem->remove($finder);

src/Eccube/Controller/Admin/Content/CacheController.php 1 location

@@ 54-58 (lines=5) @@
51
            $filesystem = new Filesystem();
52
53
            foreach ($data as $dir) {
54
                if (is_dir($cacheDir.'/'.$dir)) {
55
                    // 指定されたキャッシュディレクトリを削除
56
                    $finder = Finder::create()->in($cacheDir.'/'.$dir);
57
                    $filesystem->remove($finder);
58
                }
59
                if ($dir == 'doctrine') {
60
                    // doctrineが指定された場合は, cache driver経由で削除.
61
                    $config =  $app['orm.em']->getConfiguration();