Passed
Pull Request — master (#1500)
by Michael
09:16
created

Configurator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 28
c 1
b 0
f 0
dl 0
loc 38
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 19 1
1
<?php declare(strict_types=1);
2
3
namespace XoopsModules\Moduleinstaller\Common;
4
5
/*
6
 You may not change or alter any portion of this comment or credits
7
 of supporting developers from this source code or any supporting source code
8
 which is considered copyrighted (c) material of the original comment or credit authors.
9
10
 This program is distributed in the hope that it will be useful,
11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
 */
14
15
/**
16
 * Configurator Class
17
 *
18
 * @copyright   XOOPS Project (https://xoops.org)
19
 * @license     GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
20
 * @author      XOOPS Development Team
21
 */
22
23
/**
24
 * Class Configurator
25
 */
26
class Configurator
27
{
28
    public string $name;
29
    public array  $paths           = [];
30
    public array  $uploadFolders   = [];
31
    public array  $copyBlankFiles  = [];
32
    public array  $copyTestFolders = [];
33
    public array  $templateFolders = [];
34
    public array  $oldFiles        = [];
35
    public array  $oldFolders      = [];
36
    public array  $renameTables    = [];
37
    public array  $renameColumns   = [];
38
    public array  $moduleStats     = [];
39
    public string $modCopyright;
40
    public array  $icons           = [];
41
42
    /**
43
     * Configurator constructor.
44
     */
45
    public function __construct()
46
    {
47
        $config = require \dirname(__DIR__, 2) . '/config/config.php';
48
49
        $this->name            = $config->name;
50
//        $this->paths           = $config->paths;
51
        $this->uploadFolders   = $config->uploadFolders;
52
        $this->copyBlankFiles  = $config->copyBlankFiles;
53
        $this->copyTestFolders = $config->copyTestFolders;
54
        $this->templateFolders = $config->templateFolders;
55
        $this->oldFiles        = $config->oldFiles;
56
        $this->oldFolders      = $config->oldFolders;
57
        $this->renameTables    = $config->renameTables;
58
        $this->renameColumns   = $config->renameColumns;
59
        $this->moduleStats     = $config->moduleStats;
60
        $this->modCopyright    = $config->modCopyright;
61
62
        $this->icons = require \dirname(__DIR__, 2) . '/config/icons.php';
63
        $this->paths = require \dirname(__DIR__, 2) . '/config/paths.php';
64
    }
65
}
66