Passed
Branch master (e0df62)
by Michael
06:22
created

getConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 61
Code Lines 42

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 42
c 1
b 0
f 0
dl 0
loc 61
rs 9.248
cc 1
nc 1
nop 0

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
 * @since
16
 * @author       XOOPS Development Team
17
 */
18
function getConfig()
19
{
20
    $moduleDirName      = basename(dirname(__DIR__));
21
    $moduleDirNameUpper = mb_strtoupper($moduleDirName);
22
23
    return (object)[
24
        'name'           => mb_strtoupper($moduleDirName) . ' Module Configurator',
25
        'paths'          => [
26
            'dirname'    => $moduleDirName,
27
            'admin'      => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin',
28
            'modPath'    => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName,
29
            'modUrl'     => XOOPS_URL . '/modules/' . $moduleDirName,
30
            'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
31
            'uploadUrl'  => XOOPS_UPLOAD_URL . '/' . $moduleDirName,
32
        ],
33
        'uploadFolders'  => [
34
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
35
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/images',
36
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/thumbs',
37
        ],
38
        'copyBlankFiles' => [
39
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/images',
40
            XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/thumbs',
41
        ],
42
43
        'copyTestFolders' => [
44
            [
45
                XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/uploads/images',
46
                XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/images',
47
            ],
48
            [
49
                XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/uploads/thumbs',
50
                XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/thumbs',
51
            ],
52
        ],
53
54
        'templateFolders' => [
55
            '/templates/',
56
            '/templates/blocks/',
57
            '/templates/admin/',
58
        ],
59
        'oldFiles'        => [
60
            '/class/request.php',
61
            '/class/registry.php',
62
            '/class/utilities.php',
63
            '/class/util.php',
64
            // '/include/constants.php',
65
            // '/include/functions.php',
66
            '/ajaxrating.txt',
67
        ],
68
        'oldFolders'      => [
69
            '/images',
70
            '/css',
71
            '/js',
72
            '/tcpdf',
73
            '/images',
74
        ],
75
        'renameTables'    => [//         'XX_archive'     => 'ZZZZ_archive',
76
        ],
77
        'modCopyright'    => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'>
78
                     <img src='" . constant($moduleDirNameUpper . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>',
79
    ];
80
}
81