GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 1db939...f19805 )
by Steve
05:44
created

Helper   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 8
lcom 1
cbo 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setBootstrapNamespace() 0 4 1
A bootstrapAsset() 0 4 1
A getBootstrapNamespace() 0 15 5
A bootstrap() 0 5 1
1
<?php
2
3
namespace bedezign\yii2\audit\components\web;
4
5
/**
6
 * Web Helper
7
 * @package bedezign\yii2\audit\components\web
8
 */
9
class Helper extends \yii\base\BaseObject
10
{
11
    protected static $_bootstrapNamespace = null;
12
13
    public static function setBootstrapNamespace($namespace)
14
    {
15
        self::$_bootstrapNamespace = $namespace;
16
    }
17
18
    public static function bootstrapAsset()
19
    {
20
        return sprintf('%s\\BootstrapAsset', static::getBootstrapNamespace());
21
    }
22
23
    protected static function getBootstrapNamespace()
24
    {
25
        if (self::$_bootstrapNamespace === null) {
26
            $checkNamespaces = ['\yii\bootstrap', '\yii\bootstrap4'];
27
            foreach ($checkNamespaces as $namespace) {
28
                if (class_exists("$namespace\\BootstrapAsset")) {
29
                    self::$_bootstrapNamespace = $namespace;
30
                }
31
            }
32
        }
33
        if (self::$_bootstrapNamespace === null) {
34
            throw new \RuntimeException("Unable to determine the bootstrap version");
35
        }
36
        return self::$_bootstrapNamespace;
37
    }
38
39
    public static function bootstrap($class, $function, ...$parameters)
40
    {
41
        $class = sprintf("%s\\$class", static::getBootstrapNamespace());
42
        return call_user_func_array([$class, $function], $parameters);
43
    }
44
}