Passed
Push — master ( be43a3...3139c5 )
by Michael
06:12 queued 01:07
created

getConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 64
Code Lines 43

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 43
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 64
rs 9.232

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/*
3
 * You may not change or alter any portion of this comment or credits
4
 * of supporting developers from this source code or any supporting source code
5
 * which is considered copyrighted (c) material of the original comment or credit authors.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
 */
11
12
/**
13
 * @copyright    XOOPS Project https://xoops.org/
14
 * @license      GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
15
 * @package
16
 * @since
17
 * @author       XOOPS Development Team
18
 */
19
function getConfig()
20
{
21
    $moduleDirName      = basename(dirname(__DIR__));
22
    $moduleDirNameUpper = mb_strtoupper($moduleDirName);
23
24
    return (object)[
25
        'name'           => mb_strtoupper($moduleDirName) . ' Module Configurator',
26
        'paths'          => [
27
            'dirname'    => $moduleDirName,
28
            'admin'      => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin',
29
            'modPath'    => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName,
30
            'modUrl'     => XOOPS_URL . '/modules/' . $moduleDirName,
31
            'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
32
            'uploadUrl'  => XOOPS_UPLOAD_URL . '/' . $moduleDirName,
33
        ],
34
        'uploadFolders'  => [
35
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
36
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category',
37
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots',
38
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/thumbs',
39
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/midsize',
40
            //XOOPS_UPLOAD_PATH . '/flags'
41
        ],
42
        'copyBlankFiles' => [
43
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
44
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category',
45
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots',
46
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/thumbs',
47
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/midsize',
48
            //XOOPS_UPLOAD_PATH . '/flags'
49
        ],
50
51
        'copyTestFolders' => [
52
            //[
53
            //    constant($moduleDirNameUpper . '_PATH') . '/testdata/images',
54
            //    XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/images',
55
            //]
56
        ],
57
58
        'templateFolders' => [
59
            '/templates/',
60
            '/templates/blocks/',
61
            '/templates/admin/',
62
        ],
63
        'oldFiles'        => [
64
            '/class/request.php',
65
            '/class/registry.php',
66
            '/class/utilities.php',
67
            '/class/util.php',
68
            // '/include/constants.php',
69
            // '/include/functions.php',
70
            '/ajaxrating.txt',
71
        ],
72
        'oldFolders'      => [
73
            '/images',
74
            '/css',
75
            '/js',
76
            '/tcpdf',
77
            '/images',
78
        ],
79
        'renameTables'    => [//         'XX_archive'     => 'ZZZZ_archive',
80
        ],
81
        'modCopyright'    => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'>
82
                     <img src='" . constant($moduleDirNameUpper . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>',
83
    ];
84
}
85