XoopsLocalWrapper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 10 2
1
<?php
2
/**
3
 * Xoops Localization function
4
 *
5
 * You may not change or alter any portion of this comment or credits
6
 * of supporting developers from this source code or any supporting source code
7
 * which is considered copyrighted (c) material of the original comment or credit authors.
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
 * @copyright       (c) 2000-2016 XOOPS Project (www.xoops.org)
13
 * @license             GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
14
 * @package             core
15
 * @since               2.3.0
16
 * @author              Taiwen Jiang <[email protected]>
17
 */
18
defined('XOOPS_ROOT_PATH') || exit('Restricted access');
19
20
/**
21
 * XoopsLocalWrapper
22
 *
23
 */
24
class XoopsLocalWrapper
25
{
26
    /**
27
     * @param null $language
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $language is correct as it would always require null to be passed?
Loading history...
28
     *
29
     * @return bool
30
     */
31
    public static function load($language = null)
0 ignored issues
show
Unused Code introduced by
The parameter $language is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

31
    public static function load(/** @scrutinizer ignore-unused */ $language = null)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
32
    {
33
        if (class_exists('Xoopslocal')) {
34
            return true;
35
        }
36
        require_once $GLOBALS['xoops']->path('class/xoopslocal.php');
37
        //XoopsLocal is inside language file, let us load it
38
        xoops_loadLanguage('locale');
39
40
        return true;
41
    }
42
}
43
44
/**
45
 * Enter description here...
46
 *
47
 * @return mixed
48
 */
49
function xoops_local()
50
{
51
    // get parameters
52
    $func_args = func_get_args();
53
    $func      = array_shift($func_args);
54
55
    // local method defined
56
    return call_user_func_array(array(
57
                                    'XoopsLocal',
58
                                    $func), $func_args);
59
}
60
61
XoopsLocalWrapper::load();
62