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.
Completed
Push — master ( 571668...20e334 )
by Steffen
03:11
created

UsdMissingResponse::withStatus()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 2
1
<?php
2
3
namespace SteffenBrand\CurrCurr\Response;
4
5
use GuzzleHttp\Psr7\Stream;
6
use Psr\Http\Message\ResponseInterface;
7
use Psr\Http\Message\StreamInterface;
8
9 View Code Duplication
class UsdMissingResponse implements ResponseInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
10
{
11
12
    /**
13
     * Retrieves the HTTP protocol version as a string.
14
     *
15
     * The string MUST contain only the HTTP version number (e.g., "1.1", "1.0").
16
     *
17
     * @return string HTTP protocol version.
18
     */
19
    public function getProtocolVersion()
20
    {
21
        // TODO: Implement getProtocolVersion() method.
22
    }
23
24
    /**
25
     * Return an instance with the specified HTTP protocol version.
26
     *
27
     * The version string MUST contain only the HTTP version number (e.g.,
28
     * "1.1", "1.0").
29
     *
30
     * This method MUST be implemented in such a way as to retain the
31
     * immutability of the message, and MUST return an instance that has the
32
     * new protocol version.
33
     *
34
     * @param string $version HTTP protocol version
35
     * @return static
36
     */
37
    public function withProtocolVersion($version)
38
    {
39
        // TODO: Implement withProtocolVersion() method.
40
    }
41
42
    /**
43
     * Retrieves all message header values.
44
     *
45
     * The keys represent the header name as it will be sent over the wire, and
46
     * each value is an array of strings associated with the header.
47
     *
48
     *     // Represent the headers as a string
49
     *     foreach ($message->getHeaders() as $name => $values) {
50
     *         echo $name . ": " . implode(", ", $values);
51
     *     }
52
     *
53
     *     // Emit headers iteratively:
54
     *     foreach ($message->getHeaders() as $name => $values) {
55
     *         foreach ($values as $value) {
56
     *             header(sprintf('%s: %s', $name, $value), false);
57
     *         }
58
     *     }
59
     *
60
     * While header names are not case-sensitive, getHeaders() will preserve the
61
     * exact case in which headers were originally specified.
62
     *
63
     * @return string[][] Returns an associative array of the message's headers. Each
64
     *     key MUST be a header name, and each value MUST be an array of strings
65
     *     for that header.
66
     */
67
    public function getHeaders()
68
    {
69
        // TODO: Implement getHeaders() method.
70
    }
71
72
    /**
73
     * Checks if a header exists by the given case-insensitive name.
74
     *
75
     * @param string $name Case-insensitive header field name.
76
     * @return bool Returns true if any header names match the given header
77
     *     name using a case-insensitive string comparison. Returns false if
78
     *     no matching header name is found in the message.
79
     */
80
    public function hasHeader($name)
81
    {
82
        // TODO: Implement hasHeader() method.
83
    }
84
85
    /**
86
     * Retrieves a message header value by the given case-insensitive name.
87
     *
88
     * This method returns an array of all the header values of the given
89
     * case-insensitive header name.
90
     *
91
     * If the header does not appear in the message, this method MUST return an
92
     * empty array.
93
     *
94
     * @param string $name Case-insensitive header field name.
95
     * @return string[] An array of string values as provided for the given
96
     *    header. If the header does not appear in the message, this method MUST
97
     *    return an empty array.
98
     */
99
    public function getHeader($name)
100
    {
101
        // TODO: Implement getHeader() method.
102
    }
103
104
    /**
105
     * Retrieves a comma-separated string of the values for a single header.
106
     *
107
     * This method returns all of the header values of the given
108
     * case-insensitive header name as a string concatenated together using
109
     * a comma.
110
     *
111
     * NOTE: Not all header values may be appropriately represented using
112
     * comma concatenation. For such headers, use getHeader() instead
113
     * and supply your own delimiter when concatenating.
114
     *
115
     * If the header does not appear in the message, this method MUST return
116
     * an empty string.
117
     *
118
     * @param string $name Case-insensitive header field name.
119
     * @return string A string of values as provided for the given header
120
     *    concatenated together using a comma. If the header does not appear in
121
     *    the message, this method MUST return an empty string.
122
     */
123
    public function getHeaderLine($name)
124
    {
125
        // TODO: Implement getHeaderLine() method.
126
    }
127
128
    /**
129
     * Return an instance with the provided value replacing the specified header.
130
     *
131
     * While header names are case-insensitive, the casing of the header will
132
     * be preserved by this function, and returned from getHeaders().
133
     *
134
     * This method MUST be implemented in such a way as to retain the
135
     * immutability of the message, and MUST return an instance that has the
136
     * new and/or updated header and value.
137
     *
138
     * @param string $name Case-insensitive header field name.
139
     * @param string|string[] $value Header value(s).
140
     * @return static
141
     * @throws \InvalidArgumentException for invalid header names or values.
142
     */
143
    public function withHeader($name, $value)
144
    {
145
        // TODO: Implement withHeader() method.
146
    }
147
148
    /**
149
     * Return an instance with the specified header appended with the given value.
150
     *
151
     * Existing values for the specified header will be maintained. The new
152
     * value(s) will be appended to the existing list. If the header did not
153
     * exist previously, it will be added.
154
     *
155
     * This method MUST be implemented in such a way as to retain the
156
     * immutability of the message, and MUST return an instance that has the
157
     * new header and/or value.
158
     *
159
     * @param string $name Case-insensitive header field name to add.
160
     * @param string|string[] $value Header value(s).
161
     * @return static
162
     * @throws \InvalidArgumentException for invalid header names or values.
163
     */
164
    public function withAddedHeader($name, $value)
165
    {
166
        // TODO: Implement withAddedHeader() method.
167
    }
168
169
    /**
170
     * Return an instance without the specified header.
171
     *
172
     * Header resolution MUST be done without case-sensitivity.
173
     *
174
     * This method MUST be implemented in such a way as to retain the
175
     * immutability of the message, and MUST return an instance that removes
176
     * the named header.
177
     *
178
     * @param string $name Case-insensitive header field name to remove.
179
     * @return static
180
     */
181
    public function withoutHeader($name)
182
    {
183
        // TODO: Implement withoutHeader() method.
184
    }
185
186
    /**
187
     * Gets the body of the message.
188
     *
189
     * @return StreamInterface Returns the body as a stream.
190
     */
191
    public function getBody()
192
    {
193
        $xmlString = file_get_contents(__DIR__ . '/../../resources/eurofxref-daily-usd-missing.xml');
194
        $xmlResource = fopen('data://application/xml,' . $xmlString,'r');
195
        return new Stream($xmlResource);
196
    }
197
198
    /**
199
     * Return an instance with the specified message body.
200
     *
201
     * The body MUST be a StreamInterface object.
202
     *
203
     * This method MUST be implemented in such a way as to retain the
204
     * immutability of the message, and MUST return a new instance that has the
205
     * new body stream.
206
     *
207
     * @param StreamInterface $body Body.
208
     * @return static
209
     * @throws \InvalidArgumentException When the body is not valid.
210
     */
211
    public function withBody(StreamInterface $body)
212
    {
213
        // TODO: Implement withBody() method.
214
    }
215
216
    /**
217
     * Gets the response status code.
218
     *
219
     * The status code is a 3-digit integer result code of the server's attempt
220
     * to understand and satisfy the request.
221
     *
222
     * @return int Status code.
223
     */
224
    public function getStatusCode()
225
    {
226
        return 200;
227
    }
228
229
    /**
230
     * Return an instance with the specified status code and, optionally, reason phrase.
231
     *
232
     * If no reason phrase is specified, implementations MAY choose to default
233
     * to the RFC 7231 or IANA recommended reason phrase for the response's
234
     * status code.
235
     *
236
     * This method MUST be implemented in such a way as to retain the
237
     * immutability of the message, and MUST return an instance that has the
238
     * updated status and reason phrase.
239
     *
240
     * @link http://tools.ietf.org/html/rfc7231#section-6
241
     * @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
242
     * @param int $code The 3-digit integer result code to set.
243
     * @param string $reasonPhrase The reason phrase to use with the
244
     *     provided status code; if none is provided, implementations MAY
245
     *     use the defaults as suggested in the HTTP specification.
246
     * @return static
247
     * @throws \InvalidArgumentException For invalid status code arguments.
248
     */
249
    public function withStatus($code, $reasonPhrase = '')
250
    {
251
        // TODO: Implement withStatus() method.
252
    }
253
254
    /**
255
     * Gets the response reason phrase associated with the status code.
256
     *
257
     * Because a reason phrase is not a required element in a response
258
     * status line, the reason phrase value MAY be null. Implementations MAY
259
     * choose to return the default RFC 7231 recommended reason phrase (or those
260
     * listed in the IANA HTTP Status Code Registry) for the response's
261
     * status code.
262
     *
263
     * @link http://tools.ietf.org/html/rfc7231#section-6
264
     * @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
265
     * @return string Reason phrase; must return an empty string if none present.
266
     */
267
    public function getReasonPhrase()
268
    {
269
        // TODO: Implement getReasonPhrase() method.
270
    }
271
}