Passed
Push — master ( 827974...c305a5 )
by Michael
04:03
created

Categories::getGroupsRead()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace XoopsModules\Adslight;
6
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
12
 This program is distributed in the hope that it will be useful,
13
 but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
*/
16
17
/**
18
 * Module: Adslight
19
 *
20
 * @category        Module
21
 * @author          XOOPS Development Team <https://xoops.org>
22
 * @copyright       {@link https://xoops.org/ XOOPS Project}
23
 * @license         GPL 2.0 or later
24
 */
25
26
use Xmf\Module\Helper\Permission;
27
use XoopsModules\Adslight\{
28
    Form
29
};
30
31
//$permHelper = new \Xmf\Module\Helper\Permission();
32
33
/**
34
 * Class Categories
35
 */
36
class Categories extends \XoopsObject
37
{
38
    public $helper;
39
    public $permHelper;
40
41
    /**
42
     * Constructor
43
     *
44
     * @param null
45
     */
46
    public function __construct()
47
    {
48
        parent::__construct();
49
        //        /** @var  Adslight\Helper $helper */
50
        //        $this->helper = Adslight\Helper::getInstance();
51
        $this->permHelper = new Permission();
52
53
        $this->initVar('cid', \XOBJ_DTYPE_INT);
54
        $this->initVar('pid', \XOBJ_DTYPE_INT);
55
        $this->initVar('title', \XOBJ_DTYPE_TXTBOX);
56
        $this->initVar('cat_desc', \XOBJ_DTYPE_OTHER);
57
        $this->initVar('cat_keywords', \XOBJ_DTYPE_TXTBOX);
58
        $this->initVar('img', \XOBJ_DTYPE_TXTBOX);
59
        $this->initVar('cat_order', \XOBJ_DTYPE_INT);
60
        $this->initVar('affprice', \XOBJ_DTYPE_INT);
61
        $this->initVar('cat_moderate', \XOBJ_DTYPE_INT);
62
        $this->initVar('moderate_subcat', \XOBJ_DTYPE_INT);
63
    }
64
65
    /**
66
     * Get form
67
     *
68
     * @param null
69
     * @return Adslight\Form\CategoriesForm
0 ignored issues
show
Bug introduced by
The type XoopsModules\Adslight\Adslight\Form\CategoriesForm 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...
70
     */
71
    public function getForm(): Form\CategoriesForm
72
    {
73
        $form = new Form\CategoriesForm($this);
74
        return $form;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $form returns the type XoopsModules\Adslight\Form\CategoriesForm which is incompatible with the documented return type XoopsModules\Adslight\Adslight\Form\CategoriesForm.
Loading history...
75
    }
76
77
    /**
78
     * @return array|null
79
     */
80
    public function getGroupsRead(): ?array
81
    {
82
        //$permHelper = new \Xmf\Module\Helper\Permission();
83
        return $this->permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('cid'));
84
    }
85
86
    /**
87
     * @return array|null
88
     */
89
    public function getGroupsSubmit(): ?array
90
    {
91
        //$permHelper = new \Xmf\Module\Helper\Permission();
92
        return $this->permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('cid'));
93
    }
94
95
    /**
96
     * @return array|null
97
     */
98
    public function getGroupsModeration(): ?array
99
    {
100
        //$permHelper = new \Xmf\Module\Helper\Permission();
101
        return $this->permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('cid'));
102
    }
103
}
104