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 ( 2d0137...54f172 )
by Yong
12:14 queued 08:03
created

RequestTrait   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 70
ccs 12
cts 12
cp 1
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A appendUserAgent() 0 6 1
A withUserAgent() 0 3 1
A rpc() 0 3 1
A roa() 0 3 1
A rpcRequest() 0 3 1
A roaRequest() 0 3 1
1
<?php
2
3
namespace AlibabaCloud\Client\Traits;
4
5
use AlibabaCloud\Client\AlibabaCloud;
6
use AlibabaCloud\Client\Filter\Filter;
7
use AlibabaCloud\Client\Request\UserAgent;
8
use AlibabaCloud\Client\Request\RpcRequest;
9
use AlibabaCloud\Client\Request\RoaRequest;
10
use AlibabaCloud\Client\Exception\ClientException;
11
12
/**
13
 * Trait RequestTrait
14
 *
15
 * @package   AlibabaCloud\Client\Traits
16
 *
17
 * @mixin     AlibabaCloud
18
 */
19
trait RequestTrait
20
{
21
    /**
22
     * @param string $name
23
     * @param string $value
24
     *
25
     * @throws ClientException
26
     */
27 8
    public static function appendUserAgent($name, $value)
28
    {
29 8
        Filter::name($name);
30 6
        Filter::value($value);
31
32 4
        UserAgent::append($name, $value);
33 4
    }
34
35
    /**
36
     * @param array $userAgent
37
     */
38 2
    public static function withUserAgent(array $userAgent)
39
    {
40 2
        UserAgent::with($userAgent);
41 2
    }
42
43
    /**
44
     * @param array $options
45
     *
46
     * @return RpcRequest
47
     * @throws ClientException
48
     * @deprecated
49
     * @codeCoverageIgnore
50
     */
51
    public static function rpcRequest(array $options = [])
52
    {
53
        return self::rpc($options);
54
    }
55
56
    /**
57
     * @param array $options
58
     *
59
     * @return RpcRequest
60
     * @throws ClientException
61
     */
62 39
    public static function rpc(array $options = [])
63
    {
64 39
        return new RpcRequest($options);
65
    }
66
67
    /**
68
     * @param array $options
69
     *
70
     * @return RoaRequest
71
     * @throws ClientException
72
     * @deprecated
73
     * @codeCoverageIgnore
74
     */
75
    public static function roaRequest(array $options = [])
76
    {
77
        return self::roa($options);
78
    }
79
80
    /**
81
     * @param array $options
82
     *
83
     * @return RoaRequest
84
     * @throws ClientException
85
     */
86 6
    public static function roa(array $options = [])
87
    {
88 6
        return new RoaRequest($options);
89
    }
90
}
91