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 ( 782392...50a2b9 )
by Yong
04:42
created

HttpTrait::verify()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
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\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 52
    public function timeout($timeout)
28
    {
29 52
        $this->options['timeout'] = ClientFilter::timeout($timeout);
30
31 51
        return $this;
32
    }
33
34
    /**
35
     * @param int|float $connectTimeout
36
     *
37
     * @return $this
38
     * @throws ClientException
39
     */
40 51
    public function connectTimeout($connectTimeout)
41
    {
42 51
        $this->options['connect_timeout'] = ClientFilter::connectTimeout($connectTimeout);
43
44 50
        return $this;
45
    }
46
47
    /**
48
     * @param bool $debug
49
     *
50
     * @return $this
51
     */
52 14
    public function debug($debug)
53
    {
54 14
        $this->options['debug'] = $debug;
55
56 14
        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 mixed $verify
89
     *
90
     * @return $this
91
     */
92 2
    public function verify($verify)
93
    {
94 2
        $this->options['verify'] = $verify;
95
96 2
        return $this;
97
    }
98
99
    /**
100
     * @param array $options
101
     *
102
     * @return $this
103
     */
104 81
    public function options(array $options)
105
    {
106 81
        if ($options !== []) {
107 19
            $this->options = \AlibabaCloud\Client\arrayMerge([$this->options, $options]);
108 19
        }
109
110 81
        return $this;
111
    }
112
}
113