Code Duplication    Length = 8-9 lines in 2 locations

class/Utility.php 2 locations

@@ 28-36 (lines=9) @@
25
    public static function getModuleInfo()
26
    {
27
        static $smartModule;
28
        if (null === $smartModule) {
29
            global $xoopsModule;
30
            if (null !== $xoopsModule && is_object($xoopsModule) && 'smartfaq' === $xoopsModule->getVar('dirname')) {
31
                $smartModule = $xoopsModule;
32
            } else {
33
                $hModule     = xoops_getHandler('module');
34
                $smartModule = $hModule->getByDirname('smartfaq');
35
            }
36
        }
37
38
        return $smartModule;
39
    }
@@ 49-56 (lines=8) @@
46
        static $smartConfig;
47
        if (!$smartConfig) {
48
            global $xoopsModule;
49
            if (null !== $xoopsModule && is_object($xoopsModule) && 'smartfaq' === $xoopsModule->getVar('dirname')) {
50
                global $xoopsModuleConfig;
51
                $smartConfig = $xoopsModuleConfig;
52
            } else {
53
                $smartModule = self::getModuleInfo();
54
                $hModConfig  = xoops_getHandler('config');
55
                $smartConfig = $hModConfig->getConfigsByCat(0, $smartModule->getVar('mid'));
56
            }
57
        }
58
59
        return $smartConfig;