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 (#54)
by Yong
07:38 queued 03:16
created

RequestTrait::withUserAgent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace AlibabaCloud\Client\Traits;
4
5
use AlibabaCloud\Client\AlibabaCloud;
6
use AlibabaCloud\Client\Request\RoaRequest;
7
use AlibabaCloud\Client\Request\RpcRequest;
8
use AlibabaCloud\Client\Request\UserAgent;
9
10
/**
11
 * Trait RequestTrait
12
 *
13
 * @package   AlibabaCloud\Client\Traits
14
 *
15
 * @mixin     AlibabaCloud
16
 */
17
trait RequestTrait
18
{
19
    /**
20
     * @param string $name
21
     * @param string $value
22
     */
23 4
    public static function appendUserAgent($name, $value)
24
    {
25 4
        UserAgent::append($name, $value);
26 4
    }
27
28
    /**
29
     * @param array $userAgent
30
     */
31 1
    public static function withUserAgent(array $userAgent)
32
    {
33 1
        UserAgent::with($userAgent);
34 1
    }
35
36
    /**
37
     * @param array $options
38
     *
39
     * @return RpcRequest
40
     */
41 1
    public static function rpcRequest(array $options = [])
42
    {
43 1
        return new RpcRequest($options);
44
    }
45
46
    /**
47
     * @param array $options
48
     *
49
     * @return RoaRequest
50
     */
51 3
    public static function roaRequest(array $options = [])
52
    {
53 3
        return new RoaRequest($options);
54
    }
55
}
56