Passed
Push — master ( b847d6...d6d54c )
by Michael
09:34 queued 05:00
created

Fields   A

Complexity

Total Complexity 20

Size/Duplication

Total Lines 245
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 75
c 0
b 0
f 0
dl 0
loc 245
rs 10
wmc 20

15 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 21 1
A inList() 0 3 1
A getSearchString() 0 3 1
A getForm() 0 100 4
A isLocked() 0 3 1
A inPedigree() 0 3 1
A addLitter() 0 3 1
A inAdvanced() 0 3 1
A getId() 0 5 2
A hasLookup() 0 3 1
A getSetting() 0 3 2
A hasSearch() 0 3 1
A inPie() 0 3 1
A isActive() 0 3 1
A generalLitter() 0 3 1
1
<?php namespace XoopsModules\Pedigree;
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 28 and the first side effect is on line 23.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
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
 * Pedigree module for XOOPS
14
 *
15
 * @copyright       {@link https://xoops.org/ The XOOPS Project}
16
 * @license         GPL 2.0 or later
17
 * @package         pedigree
18
 * @author          XOOPS Module Dev Team
19
 */
20
21
use XoopsModules\Pedigree;
0 ignored issues
show
Bug introduced by
This use statement conflicts with another class in this namespace, XoopsModules\Pedigree\Pedigree. Consider defining an alias.

Let?s assume that you have a directory layout like this:

.
|-- OtherDir
|   |-- Bar.php
|   `-- Foo.php
`-- SomeDir
    `-- Foo.php

and let?s assume the following content of Bar.php:

// Bar.php
namespace OtherDir;

use SomeDir\Foo; // This now conflicts the class OtherDir\Foo

If both files OtherDir/Foo.php and SomeDir/Foo.php are loaded in the same runtime, you will see a PHP error such as the following:

PHP Fatal error:  Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php

However, as OtherDir/Foo.php does not necessarily have to be loaded and the error is only triggered if it is loaded before OtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias:

// Bar.php
namespace OtherDir;

use SomeDir\Foo as SomeDirFoo; // There is no conflict anymore.
Loading history...
22
23
defined('XOOPS_ROOT_PATH') || die('Restricted access');
24
25
/**
26
 * Class Pedigree\Fields
27
 */
28
class Fields extends \XoopsObject
29
{
30
    /**
31
     * Constructor
32
     */
33
    public function __construct()
34
    {
35
        parent::__construct();
36
        $this->initVar('id', XOBJ_DTYPE_INT, null, false, 2);
37
        $this->initVar('isaActive', XOBJ_DTYPE_INT, 1, false, 1);
38
        $this->initVar('fieldName', XOBJ_DTYPE_TXTBOX, null, false, 50);
39
        $this->initVar('fieldType', XOBJ_DTYPE_ENUM, 'textbox', false);
40
        $this->initVar('lookupTable', XOBJ_DTYPE_INT, 0, false, 1);
41
        $this->initVar('defaultValue', XOBJ_DTYPE_TXTBOX, null, false, 50);
42
        $this->initVar('fieldExplanation', XOBJ_DTYPE_TXTAREA, null, false);
43
        $this->initVar('hasSearch', XOBJ_DTYPE_INT, 0, false, 1);
44
        $this->initVar('litter', XOBJ_DTYPE_INT, 0, false, 1);
45
        $this->initVar('generalLitter', XOBJ_DTYPE_INT, 1, false, 1);
46
        $this->initVar('searchName', XOBJ_DTYPE_TXTBOX, null, false, 50);
47
        $this->initVar('searchExplanation', XOBJ_DTYPE_TXTAREA, null, false);
48
        $this->initVar('viewInPedigree', XOBJ_DTYPE_INT, 1, false, 1);
49
        $this->initVar('viewInAdvanced', XOBJ_DTYPE_INT, 1, false, 1);
50
        $this->initVar('viewInPie', XOBJ_DTYPE_INT, 1, false, 1);
51
        $this->initVar('viewInList', XOBJ_DTYPE_INT, 1, false, 1);
52
        $this->initVar('locked', XOBJ_DTYPE_INT, 0, false, 1);
53
        $this->initVar('order', XOBJ_DTYPE_INT, 0, false, 3);
54
    }
55
56
    /**
57
     * @param bool $action
58
     *
59
     * @todo refactor to eliminate XoopsObjectTree since it's not structured to
60
     *       handle this type of object
61
     *
62
     * @return object {@see XoopsThemeForm}
63
     */
64
    public function getForm($action = false)
65
    {
66
        if (false === $action) {
67
            $action = $_SERVER['REQUEST_URI'];
68
        }
69
70
        /** \XoopsModules\Pedigree\Helper $helper */
71
        $helper = \XoopsModules\Pedigree\Helper::getInstance();
72
        $helper->loadLanguage('admin');
73
74
        $title = $this->isNew() ? sprintf(_AM_PEDIGREE_PEDIGREE_CONFIG_ADD) : sprintf(_AM_PEDIGREE_PEDIGREE_CONFIG_EDIT);
75
76
        require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
77
78
        $form = new \XoopsThemeForm($title, 'form', $action, 'post', true);
79
        $form->setExtra('enctype="multipart/form-data"');
80
81
        $form->addElement(new \XoopsFormText(_AM_PEDIGREE_PEDIGREE_CONFIG_FIELDNAME, 'fieldName', 50, 255, $this->getVar('FieldName')), true);
0 ignored issues
show
Bug introduced by
It seems like $this->getVar('FieldName') can also be of type array and array; however, parameter $value of XoopsFormText::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

81
        $form->addElement(new \XoopsFormText(_AM_PEDIGREE_PEDIGREE_CONFIG_FIELDNAME, 'fieldName', 50, 255, /** @scrutinizer ignore-type */ $this->getVar('FieldName')), true);
Loading history...
82
        $form->addElement(new \XoopsFormRadioYN(_AM_PEDIGREE_PEDIGREE_CONFIG_ISACTIVE, 'isActive', (int)$this->getVar('isActive')), false);
83
        $fieldTypes = new \XoopsFormSelect(_AM_PEDIGREE_PEDIGREE_CONFIG_FIELDTYPE, 'fieldType', $this->getVar('FieldType'), false);
0 ignored issues
show
Bug introduced by
false of type false is incompatible with the type integer expected by parameter $size of XoopsFormSelect::__construct(). ( Ignorable by Annotation )

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

83
        $fieldTypes = new \XoopsFormSelect(_AM_PEDIGREE_PEDIGREE_CONFIG_FIELDTYPE, 'fieldType', $this->getVar('FieldType'), /** @scrutinizer ignore-type */ false);
Loading history...
84
        $fieldTypes->addOptionArray([
85
                                        'DateSelect'  => 'DateSelect',
86
                                        'Picture'     => 'Picture',
87
                                        'radiobutton' => 'radiobutton',
88
                                        'selectbox'   => 'selectbox',
89
                                        'textarea'    => 'textarea',
90
                                        'textbox'     => 'textbox',
91
                                        'urlfield'    => 'urlfield'
92
                                    ]);
93
        $form->addElement($fieldTypes);
94
        //        $form->addElement(new \XoopsFormTextArea(_AM_PEDIGREE_PEDIGREE_CONFIG_FIELDTYPE, "FieldType", $this->getVar("FieldType"), 4, 47), false);
0 ignored issues
show
Unused Code Comprehensibility introduced by
66% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
95
        $form->addElement(new \XoopsFormText(_AM_PEDIGREE_PEDIGREE_CONFIG_LOOKUPTABLE, 'lookupTable', 50, 255, $this->getVar('LookupTable')), false);
96
        $form->addElement(new \XoopsFormText(_AM_PEDIGREE_PEDIGREE_CONFIG_DEFAULTVALUE, 'defaultValue', 50, 255, $this->getVar('DefaultValue')), false);
97
        $form->addElement(new \XoopsFormText(_AM_PEDIGREE_PEDIGREE_CONFIG_FIELDEXPLANATION, 'fieldExplanation', 50, 255, $this->getVar('FieldExplanation')), false);
98
        $form->addElement(new \XoopsFormRadioYN(_AM_PEDIGREE_PEDIGREE_CONFIG_HASSEARCH, 'hasSearch', (int)$this->getVar('HasSearch')), false);
99
        /* @todo: should be single select for either General Litter or Litter, can't have both */
100
        $currentType = $this->getVar('litter') ? 'litter' : 'generallitter';
101
        $litterRadio = new \XoopsFormRadio(_AM_PEDIGREE_PEDIGREE_CONFIG_LITTER_TYPE, 'litterType', $currentType);
102
        $litterRadio->addOptionArray([
103
                                         'litter'        => _AM_PEDIGREE_PEDIGREE_CONFIG_LITTER,
104
                                         'generallitter' => _AM_PEDIGREE_PEDIGREE_CONFIG_GENERALLITTER
105
                                     ]);
106
        $form->addElement($litterRadio, false);
107
        //        $form->addElement(new \XoopsFormRadioYN(_AM_PEDIGREE_PEDIGREE_CONFIG_LITTER, "Litter", $this->getVar("Litter")), false);
0 ignored issues
show
Unused Code Comprehensibility introduced by
68% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
108
        //        $form->addElement(new \XoopsFormRadioYN(_AM_PEDIGREE_PEDIGREE_CONFIG_GENERALLITTER, "Generallitter", $this->getVar("Generallitter")), false);
0 ignored issues
show
Unused Code Comprehensibility introduced by
68% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
109
        $form->addElement(new \XoopsFormText(_AM_PEDIGREE_PEDIGREE_CONFIG_SEARCHNAME, 'searchName', 50, 255, $this->getVar('SearchName')), false);
110
        $form->addElement(new \XoopsFormText(_AM_PEDIGREE_PEDIGREE_CONFIG_SEARCHEXPLANATION, 'searchExplanation', 50, 255, $this->getVar('SearchExplanation')), false);
111
        $form->addElement(new \XoopsFormRadioYN(_AM_PEDIGREE_PEDIGREE_CONFIG_VIEWINPEDIGREE, 'viewInPedigree', (int)$this->getVar('viewinpedigree')), false);
112
        $form->addElement(new \XoopsFormRadioYN(_AM_PEDIGREE_PEDIGREE_CONFIG_VIEWINADVANCED, 'viewInAdvanced', (int)$this->getVar('ViewInAdvanced')), false);
113
        $form->addElement(new \XoopsFormRadioYN(_AM_PEDIGREE_PEDIGREE_CONFIG_VIEWINPIE, 'viewInPie', (int)$this->getVar('ViewInPie')), false);
114
        $form->addElement(new \XoopsFormRadioYN(_AM_PEDIGREE_PEDIGREE_CONFIG_VIEWINLIST, 'viewInList', (int)$this->getVar('ViewInList')), false);
115
        $form->addElement(new \XoopsFormRadioYN(_AM_PEDIGREE_PEDIGREE_CONFIG_LOCKED, 'locked', (int)$this->getVar('locked')), false);
116
        $form->addElement(new \XoopsFormText(_AM_PEDIGREE_PEDIGREE_CONFIG_ORDER, 'order', 3, 8, (int)$this->getVar('order')), false);
117
        //            include_once(XOOPS_ROOT_PATH."/class/tree.php");
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
118
        //            $Handler = xoops_getModuleHandler("animal_", $GLOBALS['xoopsDB']->getVar("dirname"));
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
119
        //            $criteria = new \CriteriaCompo();
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
120
        //            $criteria->setSort('_id');
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
121
        //            $criteria->setOrder('ASC');
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
122
        //            $_arr = $Handler->getAll();
0 ignored issues
show
Unused Code Comprehensibility introduced by
55% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
123
        //            $mytree = new \XoopsObjectTree($_arr, "_id", "_pid");
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
124
        //            $form->addElement(new \XoopsFormLabel(_AM_PEDIGREE_PEDIGREE_CONFIG_LOCKED, $mytree->makeSelBox("_pid", "_title","--", $this->getVar("_pid"),false)));
0 ignored issues
show
Unused Code Comprehensibility introduced by
73% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
125
        //
126
        //            include_once(XOOPS_ROOT_PATH."/class/tree.php");
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
127
        //            $Handler = xoops_getModuleHandler("animal_", $GLOBALS['xoopsModule']->getVar("dirname"));
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
128
        //            $criteria = new \CriteriaCompo();
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
129
        //            $criteria->setSort('_id');
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
130
        //            $criteria->setOrder('ASC');
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
131
        //            $_arr = $Handler->getAll();
0 ignored issues
show
Unused Code Comprehensibility introduced by
55% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
132
        //            $mytree = new \XoopsObjectTree($_arr, "_id", "_pid");
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
133
        //            $form->addElement(new \XoopsFormLabel(_AM_PEDIGREE_PEDIGREE_CONFIG_ORDER, $mytree->makeSelBox("_pid", "_title","--", $this->getVar("_pid"),false)));
0 ignored issues
show
Unused Code Comprehensibility introduced by
73% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
134
        /*
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
135
                require_once $GLOBALS['xoops']->path("class/tree.php");
136
        //      $Handler = xoops_getModuleHandler("animal_", $GLOBALS['xoopsModule']->getVar("dirname"));
137
                $Handler = Pedigree\Helper::getInstance()->getHandler('Fields');
138
        //        $Handler = & $fieldsHandler;
139
                $criteria = new \CriteriaCompo();
140
                $criteria->setSort('id');
141
                $criteria->setOrder('ASC');
142
                $_arr   = $Handler->getAll();
143
                $mytree = new \XoopsObjectTree($_arr, "ID", "_pid");
144
                $form->addElement(new \XoopsFormLabel(_AM_PEDIGREE_PEDIGREE_CONFIG_LOCKED, $mytree->makeSelBox("_pid", "_title", "--", $this->getVar("_pid"), false)));
145
        */
146
        $form->addElement(new \XoopsFormHidden('op', 'save_pedigree_config'));
147
148
        //Submit buttons
149
        $form->addElement(new \XoopsFormButtonTray('fieldButtons', _SUBMIT, 'submit'));
150
151
        /*
0 ignored issues
show
Unused Code Comprehensibility introduced by
61% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
152
                $button_tray   = new \XoopsFormElementTray("", "");
153
                $submit_button = new \XoopsFormButton("", "submit", _SUBMIT, "submit");
154
                $button_tray->addElement($submit_button);
155
156
                $cancel_button = new \XoopsFormButton("", "", _CANCEL, "cancel");
157
                $cancel_button->setExtra('onclick="history.go(-1)"');
158
                $button_tray->addElement($cancel_button);
159
160
                $form->addElement($button_tray);
161
        */
162
163
        return $form;
164
    }
165
166
    /**
167
     * @return bool
168
     */
169
    public function isActive()
170
    {
171
        return (1 == $this->getVar('isActive'));// ? true : false;
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
172
    }
173
174
    /**
175
     * @return bool
176
     */
177
    public function inAdvanced()
178
    {
179
        return (1 == $this->getVar('viewInAdvanced'));// ? true : false;
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
180
    }
181
182
    /**
183
     * @return bool
184
     */
185
    public function isLocked()
186
    {
187
        return (1 == $this->getVar('locked'));// ? true : false;
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
188
    }
189
190
    /**
191
     * @return bool
192
     */
193
    public function hasSearch()
194
    {
195
        return (1 == $this->getVar('hasSearch'));// ? true : false;
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
196
    }
197
198
    /**
199
     * @return bool
200
     */
201
    public function addLitter()
202
    {
203
        return (1 == $this->getVar('litter'));// ? true : false;
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
204
    }
205
206
    /**
207
     * @return bool
208
     */
209
    public function generalLitter()
210
    {
211
        return (1 == $this->getVar('generalLitter'));// ? true : false;
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
212
    }
213
214
    /**
215
     * @return bool
216
     */
217
    public function hasLookup()
218
    {
219
        return (1 == $this->getVar('lookupTable'));// ? true : false;
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
220
    }
221
222
    /**
223
     * @return string
224
     */
225
    public function getSearchString()
226
    {
227
        return '&amp;o=naam&amp;p';
228
    }
229
230
    /**
231
     * @return bool
232
     */
233
    public function inPie()
234
    {
235
        return (1 == $this->getVar('viewInPie'));// ? true : false;
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
236
    }
237
238
    /**
239
     * @return bool
240
     */
241
    public function inPedigree()
242
    {
243
        return (1 == $this->getVar('viewInPedigree'));// ? true : false;
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
244
    }
245
246
    /**
247
     * @return bool
248
     */
249
    public function inList()
250
    {
251
        return (1 == $this->getVar('viewInList'));// ? true : false;
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
252
    }
253
254
    /**
255
     * @return int|mixed
256
     */
257
    public function getId()
258
    {
259
        $id = $this->getVar('id');
260
261
        return !empty($id) ? $id : 0;
262
    }
263
264
    /**
265
     * @deprecated
266
     * @param $setting
267
     *
268
     * @return mixed
269
     */
270
    public function getSetting($setting)
271
    {
272
        return isset($this->$setting) ? $this->setting : null;
0 ignored issues
show
Bug Best Practice introduced by
The property setting does not exist on XoopsModules\Pedigree\Fields. Did you maybe forget to declare it?
Loading history...
273
    }
274
}
275