Helper::getInstance()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php namespace Xoopsmodules\randomquote;
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
 * Module: randomquote
14
 *
15
 * @category        Module
16
 * @package         randomquote
17
 * @author          XOOPS Development Team <[email protected]> - <https://xoops.org>
18
 * @copyright       {@link https://xoops.org/ XOOPS Project}
19
 * @license         GPL 2.0 or later
20
 * @link            https://xoops.org/
21
 * @since           1.0.0
22
 */
23
/**
24
 * Class Helper
25
 */
26
class Helper extends \Xmf\Module\Helper
27
{
28
    public $debug;
29
30
    /**
31
     * Constructor
32
     *
33
     * @param bool $debug
34
     */
35
    protected function __construct($debug = false)
36
    {
37
        $this->debug   = $debug;
38
        $this->dirname = basename(dirname(__DIR__));
39
    }
40
41
    /**
42
     * @param bool $debug
43
     * @return \Xoopsmodules\randomquote\Helper
44
     */
45
    public static function getInstance($debug = false)
46
    {
47
        static $instance;
48
        if (null === $instance) {
49
            $instance = new static($debug);
50
        }
51
        return $instance;
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function getDirname()
58
    {
59
        return $this->dirname;
60
    }
61
62
}
63