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

DeprecatedTrait::getContent()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace AlibabaCloud\Client\Request\Traits;
4
5
use AlibabaCloud\Client\Exception\ClientException;
6
use RuntimeException;
7
use AlibabaCloud\Client\Request\Request;
8
9
/**
10
 * @package    AlibabaCloud\Client\Request\Traits
11
 *
12
 * @mixin Request
13
 */
14
trait DeprecatedTrait
15
{
16
17
    /**
18
     * @param $content
19
     *
20
     * @return $this
21
     * @throws ClientException
22
     * @deprecated
23
     * @codeCoverageIgnore
24
     */
25
    public function setContent($content)
26
    {
27
        return $this->body($content);
0 ignored issues
show
Bug introduced by
It seems like body() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        return $this->/** @scrutinizer ignore-call */ body($content);
Loading history...
28
    }
29
30
    /**
31
     * @param $method
32
     *
33
     * @return $this
34
     * @throws ClientException
35
     * @deprecated
36
     * @codeCoverageIgnore
37
     */
38
    public function setMethod($method)
39
    {
40
        return $this->method($method);
0 ignored issues
show
Bug introduced by
It seems like method() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

40
        return $this->/** @scrutinizer ignore-call */ method($method);
Loading history...
41
    }
42
43
    /**
44
     * @param $scheme
45
     *
46
     * @return $this
47
     * @throws ClientException
48
     * @deprecated
49
     * @codeCoverageIgnore
50
     */
51
    public function setProtocol($scheme)
52
    {
53
        return $this->scheme($scheme);
0 ignored issues
show
Bug introduced by
It seems like scheme() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

53
        return $this->/** @scrutinizer ignore-call */ scheme($scheme);
Loading history...
54
    }
55
56
    /**
57
     * @deprecated
58
     * @codeCoverageIgnore
59
     */
60
    public function getProtocolType()
61
    {
62
        return $this->uri->getScheme();
63
    }
64
65
    /**
66
     * @param $scheme
67
     *
68
     * @return $this
69
     * @throws ClientException
70
     * @deprecated
71
     * @codeCoverageIgnore
72
     */
73
    public function setProtocolType($scheme)
74
    {
75
        return $this->scheme($scheme);
76
    }
77
78
    /**
79
     * @param $actionName
80
     *
81
     * @return $this
82
     * @throws ClientException
83
     * @deprecated
84
     * @codeCoverageIgnore
85
     */
86
    public function setActionName($actionName)
87
    {
88
        return $this->action($actionName);
0 ignored issues
show
Bug introduced by
It seems like action() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

88
        return $this->/** @scrutinizer ignore-call */ action($actionName);
Loading history...
89
    }
90
91
    /**
92
     * @param $format
93
     *
94
     * @return $this
95
     * @throws ClientException
96
     * @deprecated
97
     * @codeCoverageIgnore
98
     */
99
    public function setAcceptFormat($format)
100
    {
101
        return $this->format($format);
0 ignored issues
show
Bug introduced by
It seems like format() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

101
        return $this->/** @scrutinizer ignore-call */ format($format);
Loading history...
102
    }
103
104
    /**
105
     * @deprecated
106
     * @codeCoverageIgnore
107
     */
108
    public function getProtocol()
109
    {
110
        return $this->uri->getScheme();
111
    }
112
113
    /**
114
     * @deprecated
115
     * @codeCoverageIgnore
116
     */
117
    public function getContent()
118
    {
119
        return isset($this->options['body'])
120
            ? $this->options['body']
121
            : null;
122
    }
123
124
    /**
125
     * @deprecated
126
     * @codeCoverageIgnore
127
     */
128
    public function getMethod()
129
    {
130
        return $this->method;
131
    }
132
133
    /**
134
     * @deprecated
135
     * @codeCoverageIgnore
136
     */
137
    public function getHeaders()
138
    {
139
        return isset($this->options['headers'])
140
            ? $this->options['headers']
141
            : [];
142
    }
143
144
    /**
145
     * @param $headerKey
146
     * @param $headerValue
147
     *
148
     * @return $this
149
     * @deprecated
150
     * @codeCoverageIgnore
151
     */
152
    public function addHeader($headerKey, $headerValue)
153
    {
154
        $this->options['headers'][$headerKey] = $headerValue;
0 ignored issues
show
Bug Best Practice introduced by
The property options does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
155
156
        return $this;
157
    }
158
159
    /**
160
     * @deprecated
161
     * @codeCoverageIgnore
162
     */
163
    public function getQueryParameters()
164
    {
165
        return isset($this->options['query'])
166
            ? $this->options['query']
167
            : [];
168
    }
169
170
    /**
171
     * @param $name
172
     * @param $value
173
     *
174
     * @return $this
175
     * @deprecated
176
     * @codeCoverageIgnore
177
     */
178
    public function setQueryParameters($name, $value)
179
    {
180
        $this->options['query'][$name] = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property options does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
181
182
        return $this;
183
    }
184
185
    /**
186
     * @deprecated
187
     * @codeCoverageIgnore
188
     */
189
    public function getDomainParameter()
190
    {
191
        return isset($this->options['form_params'])
192
            ? $this->options['form_params']
193
            : [];
194
    }
195
196
    /**
197
     * @param $name
198
     * @param $value
199
     *
200
     * @return $this
201
     * @deprecated
202
     * @codeCoverageIgnore
203
     */
204
    public function putDomainParameters($name, $value)
205
    {
206
        $this->options['form_params'][$name] = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property options does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
207
208
        return $this;
209
    }
210
211
    /**
212
     * @deprecated
213
     * @codeCoverageIgnore
214
     */
215
    public function getActionName()
216
    {
217
        return $this->action;
218
    }
219
220
    /**
221
     * @deprecated
222
     * @codeCoverageIgnore
223
     */
224
    public function getAcceptFormat()
225
    {
226
        return $this->format;
227
    }
228
229
    /**
230
     * @deprecated
231
     * @codeCoverageIgnore
232
     */
233
    public function getLocationEndpointType()
234
    {
235
        return $this->endpointType;
236
    }
237
238
    /**
239
     * @deprecated
240
     * @codeCoverageIgnore
241
     */
242
    public function getLocationServiceCode()
243
    {
244
        return $this->serviceCode;
245
    }
246
}
247