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 ( 13e329...ecc4d0 )
by Yong
05:43
created

HttpTrait   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 86
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 86
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0
wmc 7

6 Methods

Rating   Name   Duplication   Size   Complexity  
A options() 0 7 2
A cert() 0 5 1
A connectTimeout() 0 5 1
A proxy() 0 5 1
A timeout() 0 5 1
A debug() 0 5 1
1
<?php
2
3
namespace AlibabaCloud\Client\Traits;
4
5
use AlibabaCloud\Client\Exception\ClientException;
6
use AlibabaCloud\Client\Filter\ClientFilter;
7
8
/**
9
 * Trait HttpTrait
10
 *
11
 * @package AlibabaCloud\Client\Traits
12
 */
13
trait HttpTrait
14
{
15
16
    /**
17
     * @var array
18
     */
19
    public $options = [];
20
21
    /**
22
     * @param int|float $timeout
23
     *
24
     * @return $this
25
     * @throws ClientException
26
     */
27 50
    public function timeout($timeout)
28
    {
29 50
        $this->options['timeout'] = ClientFilter::timeout($timeout);
30
31 49
        return $this;
32
    }
33
34
    /**
35
     * @param int|float $connectTimeout
36
     *
37
     * @return $this
38
     * @throws ClientException
39
     */
40 49
    public function connectTimeout($connectTimeout)
41
    {
42 49
        $this->options['connect_timeout'] = ClientFilter::connectTimeout($connectTimeout);
43
44 48
        return $this;
45
    }
46
47
    /**
48
     * @param bool $debug
49
     *
50
     * @return $this
51
     */
52 13
    public function debug($debug)
53
    {
54 13
        $this->options['debug'] = $debug;
55
56 13
        return $this;
57
    }
58
59
    /**
60
     * @codeCoverageIgnore
61
     *
62
     * @param array $cert
63
     *
64
     * @return $this
65
     */
66
    public function cert($cert)
67
    {
68
        $this->options['cert'] = $cert;
69
70
        return $this;
71
    }
72
73
    /**
74
     * @codeCoverageIgnore
75
     *
76
     * @param array|string $proxy
77
     *
78
     * @return $this
79
     */
80
    public function proxy($proxy)
81
    {
82
        $this->options['proxy'] = $proxy;
83
84
        return $this;
85
    }
86
87
    /**
88
     * @param array $options
89
     *
90
     * @return $this
91
     */
92 85
    public function options(array $options)
93
    {
94 85
        if ($options !== []) {
95 20
            $this->options = \AlibabaCloud\Client\arrayMerge([$this->options, $options]);
96 20
        }
97
98 85
        return $this;
99
    }
100
}
101