Passed
Push — master ( e3d02e...b8a1dc )
by Michael
03:24 queued 12s
created

XoopsheadlineUtility   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 8
c 1
b 0
f 0
dl 0
loc 23
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getRenderer() 0 13 3
1
<?php
2
3
namespace XoopsModules\Xoopsheadline;
4
5
/**
6
 *  xoopsheadline Utility Class Elements
7
 *
8
 * @copyright ::  ZySpec Incorporated
9
 * @license   ::    {@link https://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
10
 * @package   ::    xoopsheadline
11
 * @subpackage:: class
12
 * @author    ::     unknown, zyspec ([email protected])
13
 * @since     ::     File available since release 1.10
14
 */
15
16
/**
17
 * XoopsheadlineUtility
18
 *
19
 * @package  ::   xoopsheadline
20
 * @author   ::    zyspec ([email protected])
21
 * @copyright:: Copyright (c) 2010 ZySpec Incorporated, Herve Thouzard
22
 * @access::    public
23
 */
24
class XoopsheadlineUtility
25
{
26
    /**
27
     * XoopsheadlineUtility
28
     *
29
     * Function to create appropriate Renderer
30
     * (based on locale)
31
     * @param $headline
32
     * @return HeadlineRenderer|\HeadlineRendererLocal
0 ignored issues
show
Bug introduced by
The type HeadlineRendererLocal was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
33
     */
34
    public static function getRenderer($headline)
35
    {
36
        if (is_file(XOOPS_ROOT_PATH . '/modules/xoopsheadline/language/' . $GLOBALS['xoopsConfig']['language'] . '/headlinerenderer.php')) {
37
            require_once XOOPS_ROOT_PATH . '/modules/xoopsheadline/language/' . $GLOBALS['xoopsConfig']['language'] . '/headlinerenderer.php';
38
            if (class_exists('HeadlineRendererLocal')) {
39
                $myhl = new HeadlineRendererLocal($headline);
0 ignored issues
show
Bug introduced by
The type XoopsModules\Xoopsheadline\HeadlineRendererLocal was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
40
41
                return $myhl;
42
            }
43
        }
44
        $myhl = new HeadlineRenderer($headline);
45
46
        return $myhl;
47
    }
48
}
49