Passed
Push — master ( 77f10d...b1f89f )
by Michael
03:06
created

PreferencesForm   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 35
dl 0
loc 68
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 60 3
1
<?php
2
3
namespace XoopsModules\Xoositemap\Form;
4
5
/**
6
 * Xoositemap module
7
 *
8
 * You may not change or alter any portion of this comment or credits
9
 * of supporting developers from this source code or any supporting source code
10
 * which is considered copyrighted (c) material of the original comment or credit authors.
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
 *
15
 * @copyright       The XOOPS Project http://sourceforge.net/projects/xoops/
16
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
17
 * @package         Xoositemap
18
 * @since           2.6.0
19
 * @author          Laurent JEN (Aka DuGris)
20
 * @version         $Id$
21
 */
22
class PreferencesForm extends \Xoops\Form\ThemeForm
0 ignored issues
show
Bug introduced by
The type Xoops\Form\ThemeForm was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
23
{
24
    private $config = [];
0 ignored issues
show
introduced by
The private property $config is not used, and could be removed.
Loading history...
25
26
    /**
27
     * @param string $config
28
     * @internal param null $obj
29
     */
30
    public function __construct($config)
31
    {
32
        extract($config);
0 ignored issues
show
Bug introduced by
$config of type string is incompatible with the type array expected by parameter $var_array of extract(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

32
        extract(/** @scrutinizer ignore-type */ $config);
Loading history...
33
34
        parent::__construct('', 'form_preferences', 'preferences.php', 'post', true);
35
        $this->setExtra('enctype="multipart/form-data"');
36
37
        $tabTray = new \Xoops\Form\TabTray('', 'uniqueid');
0 ignored issues
show
Bug introduced by
The type Xoops\Form\TabTray was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
38
39
        /**
40
         * Main page
41
         */
42
        $tab1 = new \Xoops\Form\Tab(_XOO_CONFIG_MAINPAGE, 'tabid-1');
0 ignored issues
show
Bug introduced by
The type Xoops\Form\Tab was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
43
        $tab1->addElement(new \Xoops\Form\RadioYesNo(_XOO_CONFIG_MAIN, 'xoositemap_main', $xoositemap_main));
0 ignored issues
show
Bug introduced by
The type Xoops\Form\RadioYesNo was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
44
45
        // main
46
        $tab1->addElement(new \Xoops\Form\RadioYesNo(_XOO_CONFIG_SUBCAT, 'xoositemap_subcat', $xoositemap_subcat));
47
48
        // welcome
49
        $tab1->addElement(new \Xoops\Form\TextArea(_XOO_CONFIG_WELCOME, 'xoositemap_welcome', $xoositemap_welcome, 12, 12));
0 ignored issues
show
Bug introduced by
The type Xoops\Form\TextArea was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
50
51
        /**
52
         * Main page
53
         */
54
        $tab2 = new \Xoops\Form\Tab(_XOO_CONFIG_MODULES, 'tabid-2');
55
        $systemModule = new \SystemModule();
0 ignored issues
show
Bug introduced by
The type SystemModule was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
56
        $installed = $systemModule->getModuleList();
57
        $modules = new \Xoops\Form\Select(_XOO_CONFIG_MODULES_SELECT, 'xoositemapModule', $xoositemapModule, count($installed) - 1, true);
0 ignored issues
show
Bug introduced by
The type Xoops\Form\Select was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
58
        foreach ($installed as $module) {
59
            $plugin = \Xoops\Module\Plugin::getPlugin($module->getVar('dirname'), 'xoositemap');
0 ignored issues
show
Bug introduced by
The type Xoops\Module\Plugin was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
60
            if (is_object($plugin)) {
61
                $modules->addOption($module->getVar('dirname'), $module->getVar('dirname'));
62
            }
63
        }
64
        $tab2->addElement($modules);
65
66
        $tabTray->addElement($tab1);
67
        $tabTray->addElement($tab2);
68
        $this->addElement($tabTray);
69
70
        /**
71
         * Buttons
72
         */
73
        $buttonTray = new \Xoops\Form\ElementTray('', '');
0 ignored issues
show
Bug introduced by
The type Xoops\Form\ElementTray was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
74
        $buttonTray->addElement(new \Xoops\Form\Hidden('op', 'save'));
0 ignored issues
show
Bug introduced by
The type Xoops\Form\Hidden was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
75
76
        $buttonSubmit = new \Xoops\Form\Button('', 'submit', \XoopsLocale::A_SUBMIT, 'submit');
0 ignored issues
show
Bug introduced by
The type Xoops\Form\Button was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
Bug introduced by
The type XoopsLocale was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
77
        $buttonSubmit->setClass('btn btn-success');
78
        $buttonTray->addElement($buttonSubmit);
79
80
        $buttonReset = new \Xoops\Form\Button('', 'reset', \XoopsLocale::A_RESET, 'reset');
81
        $buttonReset->setClass('btn btn-warning');
82
        $buttonTray->addElement($buttonReset);
83
84
        $buttonCancel = new \Xoops\Form\Button('', 'cancel', \XoopsLocale::A_CANCEL, 'button');
85
        $buttonCancel->setExtra("onclick='javascript:history.go(-1);'");
86
        $buttonCancel->setClass('btn btn-danger');
87
        $buttonTray->addElement($buttonCancel);
88
89
        $this->addElement($buttonTray);
90
    }
91
}
92