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::bootstrapAsset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
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
}