Completed
Push — master ( 243457...d2eaaf )
by Michael
01:33
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\xsitemap;
2
3
/**
4
 * Class Helper
5
 */
6
class Helper extends \Xmf\Module\Helper
7
{
8
    public $debug;
9
10
    /**
11
     * @internal param $debug
12
     * @param bool $debug
13
     */
14
    protected function __construct($debug = false)
15
    {
16
        $this->debug   = $debug;
17
        $this->dirname = basename(dirname(__DIR__));
18
    }
19
20
    /**
21
     * @param bool $debug
22
     *
23
     * @return \Xmf\Module\Helper
24
     */
25
    public static function getInstance($debug = false)
26
    {
27
        static $instance;
28
        if (null === $instance) {
29
            $instance = new static($debug);
30
        }
31
32
        return $instance;
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getDirname()
39
    {
40
        return $this->dirname;
41
    }
42
}
43