Code Duplication    Length = 16-16 lines in 2 locations

src/Controller/Admin/ClearImageCache.php 1 location

@@ 23-38 (lines=16) @@
20
21
namespace HaaseIT\HCSF\Controller\Admin;
22
23
class ClearImageCache extends Base
24
{
25
    public function preparePage()
26
    {
27
        $this->P = new \HaaseIT\HCSF\CorePage($this->serviceManager, [], 'admin/base.twig');
28
        $this->P->cb_pagetype = 'content';
29
        $this->P->cb_subnav = 'admin';
30
31
        $this->P->oPayload->cl_html = 'The image cache has been cleared.';
32
33
        $adapter = new \League\Flysystem\Adapter\Local(PATH_CACHE);
34
        $filesystem = new \League\Flysystem\Filesystem($adapter);
35
        $filesystem->deleteDir(DIRNAME_GLIDECACHE);
36
        $filesystem->createDir(DIRNAME_GLIDECACHE);
37
    }
38
}
39

src/Controller/Admin/ClearTemplateCache.php 1 location

@@ 23-38 (lines=16) @@
20
21
namespace HaaseIT\HCSF\Controller\Admin;
22
23
class ClearTemplateCache extends Base
24
{
25
    public function preparePage()
26
    {
27
        $this->P = new \HaaseIT\HCSF\CorePage($this->serviceManager, [], 'admin/base.twig');
28
        $this->P->cb_pagetype = 'content';
29
        $this->P->cb_subnav = 'admin';
30
31
        $this->P->oPayload->cl_html = 'The template cache has been cleared.';
32
33
        $adapter = new \League\Flysystem\Adapter\Local(PATH_CACHE);
34
        $filesystem = new \League\Flysystem\Filesystem($adapter);
35
        $filesystem->deleteDir(DIRNAME_TEMPLATECACHE);
36
        $filesystem->createDir(DIRNAME_TEMPLATECACHE);
37
    }
38
}
39