Completed
Push — master ( 249590...ebae0d )
by Michael
05:58
created

class/Common/Configurator.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php namespace XoopsModules\Newbb\Common;
2
3
/*
4
 You may not change or alter any portion of this comment or credits
5
 of supporting developers from this source code or any supporting source code
6
 which is considered copyrighted (c) material of the original comment or credit authors.
7
8
 This program is distributed in the hope that it will be useful,
9
 but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 */
12
/**
13
 * Configurator Class
14
 *
15
 * @copyright   XOOPS Project (https://xoops.org)
16
 * @license     http://www.fsf.org/copyleft/gpl.html GNU public license
17
 * @author      XOOPS Development Team
18
 * @package     Publisher
19
 * @since       1.05
20
 *
21
 */
22
23
require_once __DIR__ . '/../../include/common.php';
24
25
/**
26
 * Class Configurator
27
 */
28
class Configurator
29
{
30
    public $name;
31
    public $paths           = [];
32
    public $uploadFolders   = [];
33
    public $copyBlankFiles  = [];
34
    public $copyTestFolders = [];
35
    public $templateFolders = [];
36
    public $oldFiles        = [];
37
    public $oldFolders      = [];
38
    public $modCopyright;
39
40
    /**
41
     * Configurator constructor.
42
     */
43
    public function __construct()
44
    {
45
        $moduleDirName = basename(dirname(__DIR__));
46
        $capsDirName   = strtoupper($moduleDirName);
0 ignored issues
show
$capsDirName is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
47
48
        include_once __DIR__ . '/../../include/config.php';        $config = getConfig();
49
50
        $this->name            = $config->name;
51
        $this->paths           = $config->paths;
52
        $this->uploadFolders   = $config->uploadFolders;
53
        $this->copyBlankFiles  = $config->copyBlankFiles;
54
        $this->copyTestFolders = $config->copyTestFolders;
55
        $this->templateFolders = $config->templateFolders;
56
        $this->oldFiles        = $config->oldFiles;
57
        $this->oldFolders      = $config->oldFolders;
58
        $this->modCopyright    = $config->modCopyright;
59
    }
60
}
61