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
Pull Request — master (#152)
by Yong
04:13
created

ActionResolverTrait::getActionNameFromClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace AlibabaCloud\Client\Resolver;
4
5
use ReflectionClass;
6
use ReflectionException;
7
use AlibabaCloud\Client\AlibabaCloud;
8
use AlibabaCloud\Client\Request\Request;
9
use AlibabaCloud\Client\Exception\ClientException;
10
11
/**
12
 * Trait ActionResolverTrait
13
 *
14
 * @internal
15
 * @codeCoverageIgnore
16
 * @mixin Rpc
17
 * @mixin Roa
18
 * @mixin Request
19
 * @package AlibabaCloud\Client\Resolver
20
 */
21
trait ActionResolverTrait
22
{
23
    /**
24
     * ActionResolverTrait constructor.
25
     *
26
     * @param array $options
27
     *
28
     * @throws ReflectionException
29
     * @throws ClientException
30
     */
31
    public function __construct(array $options = [])
32
    {
33
        parent::__construct($options);
34
35
        if ((new ReflectionClass(AlibabaCloud::class))->hasMethod('appendUserAgent')) {
36
            if (class_exists('AlibabaCloud\Release')) {
37
                AlibabaCloud::appendUserAgent('SDK', \AlibabaCloud\Release::VERSION);
0 ignored issues
show
Bug introduced by
The type AlibabaCloud\Release 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...
38
            }
39
        }
40
41
        if (!$this->action) {
42
            $this->action = $this->getActionNameFromClass();
0 ignored issues
show
Bug Best Practice introduced by
The property action does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
43
        }
44
    }
45
46
    /**
47
     * @return mixed
48
     */
49
    private function getActionNameFromClass()
50
    {
51
        $array = explode('\\', get_class($this));
52
53
        return array_pop($array);
54
    }
55
}
56