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.

OAuth   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 9
Bugs 0 Features 0
Metric Value
eloc 10
c 9
b 0
f 0
dl 0
loc 20
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __callStatic() 0 3 1
A init() 0 12 3
1
<?php
2
3
/**
4
 * 第三方登陆实例抽象类
5
 *
6
 * @author Coeus <[email protected]>
7
 */
8
9
namespace anerg\OAuth2;
10
11
use anerg\OAuth2\Connector\GatewayInterface;
12
use anerg\OAuth2\Helper\Str;
13
14
abstract class OAuth
15
{
16
17
    protected static function init($gateway, $config = null)
18
    {
19
        $gateway = Str::uFirst($gateway);
20
        $class   = __NAMESPACE__ . '\\Gateways\\' . $gateway;
21
        if (class_exists($class)) {
22
            $app = new $class($config);
23
            if ($app instanceof GatewayInterface) {
24
                return $app;
25
            }
26
            throw new \Exception("第三方登录基类 [$gateway] 必须继承抽象类 [GatewayInterface]");
27
        }
28
        throw new \Exception("第三方登录基类 [$gateway] 不存在");
29
    }
30
31
    public static function __callStatic($gateway, $config)
32
    {
33
        return self::init($gateway, ...$config);
0 ignored issues
show
Bug introduced by
$config is expanded, but the parameter $config of anerg\OAuth2\OAuth::init() does not expect variable arguments. ( Ignorable by Annotation )

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

33
        return self::init($gateway, /** @scrutinizer ignore-type */ ...$config);
Loading history...
34
    }
35
36
}
37