Completed
Push — master ( a4e09c...825da9 )
by Michael
01:51
created

Helper   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getInstance() 0 9 2
A getDirname() 0 4 1
1
<?php namespace Xoopsmodules\instruction;
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
/**
14
 * @copyright    XOOPS Project https://xoops.org/
15
 * @license      GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
16
 * @package
17
 * @since
18
 * @author       XOOPS Development Team
19
 */
20
//defined('XOOPS_ROOT_PATH') || exit('Restricted access');
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...
21
22
/**
23
 * Class Helper
24
 */
25
class Helper extends \Xmf\Module\Helper
26
{
27
    public $debug;
28
29
    /**
30
     * @internal param $debug
31
     * @param bool $debug
32
     */
33
    protected function __construct($debug = false)
34
    {
35
        $this->debug   = $debug;
36
        $this->dirname = basename(dirname(__DIR__));
37
    }
38
39
    /**
40
     * @param bool $debug
41
     *
42
     * @return \Xoopsmodules\instruction\Helper
43
     */
44
    public static function getInstance($debug = false)
45
    {
46
        static $instance;
47
        if (null === $instance) {
48
            $instance = new static($debug);
49
        }
50
51
        return $instance;
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function getDirname()
58
    {
59
        return $this->dirname;
60
    }
61
}
62