Completed
Push — master ( 0a3d23...5fac45 )
by Michael
02:58
created

Newbb::getDirname()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
//namespace Xoopsmodules\Newbb;
4
5
/*
6
     You may not change or alter any portion of this comment or credits
7
     of supporting developers from this source code or any supporting source code
8
     which is considered copyrighted (c) material of the original comment or credit authors.
9
10
     This program is distributed in the hope that it will be useful,
11
     but WITHOUT ANY WARRANTY; without even the implied warranty of
12
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
    */
14
/**
15
 * NewBB module for xoops
16
 *
17
 * @copyright       XOOPS Project (https://xoops.org)
18
 * @license         GPL 2.0 or later
19
 * @package         newbb
20
 * @since           5.0.0
21
 * @author          XOOPS Development Team <[email protected]> - <https://xoops.org>
22
 */
23
24
//defined('XOOPS_ROOT_PATH') || die('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...
25
26
/**
27
 * Class Helper
28
 */
29
class Newbb extends \Xmf\Module\Helper
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
30
{
31
    public $debugArray = [];
32
33
    /**
34
     * @internal param $debug
35
     */
36
    protected function __construct()
37
    {
38
        //        $this->debug   = $debug;
0 ignored issues
show
Unused Code Comprehensibility introduced by
45% 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...
39
        $this->dirname = basename(dirname(__DIR__));
40
    }
41
42
    /**
43
     * @param bool $debug
44
     *
45
     * @return Newbb
46
     */
47
    public static function getInstance($debug = false)
48
    {
49
        static $instance;
50
        if (null === $instance) {
51
            $instance = new static($debug);
52
        }
53
54
        return $instance;
55
    }
56
57
58
    /**
59
     * @param null|string $name
60
     * @param null|string $value
61
     *
62
     * @return mixed
63
     */
64
//    public function setConfig($name = null, $value = null)
0 ignored issues
show
Unused Code Comprehensibility introduced by
52% 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...
65
//    {
66
//        if (null === $this->configs) {
67
//            $this->initConfig();
68
//        }
69
//        $this->configs[$name] = $value;
70
//        $this->addLog("Setting config '{$name}' : " . $this->configs[$name]);
71
//
72
//        return $this->configs[$name];
73
//    }
74
75
    /**
76
     * @return string
77
     */
78
    public function getDirname()
79
    {
80
        return $this->dirname;
81
    }
82
}
83