Code Duplication    Length = 8-8 lines in 2 locations

include/onupdate.php 2 locations

@@ 30-37 (lines=8) @@
27
        // delete old html template files
28
        $templateDirectory = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname', 'n') . '/templates/');
29
        $templateList      = array_diff(scandir($templateDirectory), array('..', '.'));
30
        foreach ($templateList as $k => $v) {
31
            $fileInfo = new SplFileInfo($templateDirectory . $v);
32
            if ($fileInfo->getExtension() === 'html' && $fileInfo->getFilename() !== 'index.html') {
33
                if (file_exists($templateDirectory . $v)) {
34
                    unlink($templateDirectory . $v);
35
                }
36
            }
37
        }
38
        // delete old block html template files
39
        $templateDirectory = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname', 'n') . '/templates/blocks/');
40
        $templateList      = array_diff(scandir($templateDirectory), array('..', '.'));
@@ 41-48 (lines=8) @@
38
        // delete old block html template files
39
        $templateDirectory = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname', 'n') . '/templates/blocks/');
40
        $templateList      = array_diff(scandir($templateDirectory), array('..', '.'));
41
        foreach ($templateList as $k => $v) {
42
            $fileInfo = new SplFileInfo($templateDirectory . $v);
43
            if ($fileInfo->getExtension() === 'html' && $fileInfo->getFilename() !== 'index.html') {
44
                if (file_exists($templateDirectory . $v)) {
45
                    unlink($templateDirectory . $v);
46
                }
47
            }
48
        }
49
50
        //delete old files:
51
        $oldFiles = array(