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

class/Price.php (2 issues)

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 Price
34
 */
35
class Price 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('id_price', \XOBJ_DTYPE_INT);
53
        $this->initVar('nom_price', \XOBJ_DTYPE_TXTBOX);
54
    }
55
56
    /**
57
     * Get form
58
     *
59
     * @param null
60
     * @return Adslight\Form\PriceForm
0 ignored issues
show
The type XoopsModules\Adslight\Adslight\Form\PriceForm 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...
61
     */
62
    public function getForm(): Form\PriceForm
63
    {
64
        $form = new Form\PriceForm($this);
65
        return $form;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $form returns the type XoopsModules\Adslight\Form\PriceForm which is incompatible with the documented return type XoopsModules\Adslight\Adslight\Form\PriceForm.
Loading history...
66
    }
67
68
    /**
69
     * @return array|null
70
     */
71
    public function getGroupsRead(): ?array
72
    {
73
        //$permHelper = new \Xmf\Module\Helper\Permission();
74
        return $this->permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('id_price'));
75
    }
76
77
    /**
78
     * @return array|null
79
     */
80
    public function getGroupsSubmit(): ?array
81
    {
82
        //$permHelper = new \Xmf\Module\Helper\Permission();
83
        return $this->permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('id_price'));
84
    }
85
86
    /**
87
     * @return array|null
88
     */
89
    public function getGroupsModeration(): ?array
90
    {
91
        //$permHelper = new \Xmf\Module\Helper\Permission();
92
        return $this->permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('id_price'));
93
    }
94
}
95
96