Completed
Push — master ( 243457...d2eaaf )
by Michael
01:33
created

Helper::getInstance()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
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