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

Picture   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 17
dl 0
loc 63
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getGroupsSubmit() 0 4 1
A getGroupsRead() 0 4 1
A getForm() 0 4 1
A __construct() 0 14 1
A getGroupsModeration() 0 4 1
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 XoopsModules\Adslight\{
27
    Form
28
};
29
30
//$permHelper = new \Xmf\Module\Helper\Permission();
31
32
/**
33
 * Class Pictures
34
 */
35
class Picture extends \XoopsObject
36
{
37
        public $helper;
38
    public $permHelper;
39
40
    /**
41
     * Constructor
42
     *
43
     * @param null
44
     */
45
    public function __construct()
46
    {
47
        parent::__construct();
48
        //        /** @var  Adslight\Helper $helper */
49
        //        $this->helper = Adslight\Helper::getInstance();
50
        $this->permHelper = new \Xmf\Module\Helper\Permission();
51
52
        $this->initVar('cod_img', \XOBJ_DTYPE_INT);
53
        $this->initVar('title', \XOBJ_DTYPE_TXTBOX);
54
        $this->initVar('date_created', \XOBJ_DTYPE_INT);
55
        $this->initVar('date_updated', \XOBJ_DTYPE_INT);
56
        $this->initVar('lid', \XOBJ_DTYPE_INT);
57
        $this->initVar('uid_owner', \XOBJ_DTYPE_TXTBOX);
58
        $this->initVar('url', \XOBJ_DTYPE_OTHER);
59
    }
60
61
    /**
62
     * Get form
63
     *
64
     * @param null
65
     * @return Adslight\Form\PicturesForm
0 ignored issues
show
Bug introduced by
The type XoopsModules\Adslight\Adslight\Form\PicturesForm 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...
66
     */
67
    public function getForm(): Form\PicturesForm
68
    {
69
        $form = new Form\PicturesForm($this);
70
        return $form;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $form returns the type XoopsModules\Adslight\Form\PicturesForm which is incompatible with the documented return type XoopsModules\Adslight\Adslight\Form\PicturesForm.
Loading history...
71
    }
72
73
    /**
74
     * @return array|null
75
     */
76
    public function getGroupsRead(): ?array
77
    {
78
        //$permHelper = new \Xmf\Module\Helper\Permission();
79
        return $this->permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('cod_img'));
80
    }
81
82
    /**
83
     * @return array|null
84
     */
85
    public function getGroupsSubmit(): ?array
86
    {
87
        //$permHelper = new \Xmf\Module\Helper\Permission();
88
        return $this->permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('cod_img'));
89
    }
90
91
    /**
92
     * @return array|null
93
     */
94
    public function getGroupsModeration(): ?array
95
    {
96
        //$permHelper = new \Xmf\Module\Helper\Permission();
97
        return $this->permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('cod_img'));
98
    }
99
}
100
101