@@ -95,7 +95,7 @@ |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
98 | - * @return \Psr\Http\Message\ResponseInterface |
|
98 | + * @return resource |
|
99 | 99 | */ |
100 | 100 | public function init(){ |
101 | 101 |
@@ -214,12 +214,12 @@ |
||
214 | 214 | $options[CURLOPT_HTTPHEADER] = $curlHeaders; |
215 | 215 | |
216 | 216 | // If the Expect header is not present, prevent curl from adding it |
217 | - if (!$this->request->hasHeader('Expect')) { |
|
217 | + if(!$this->request->hasHeader('Expect')){ |
|
218 | 218 | $options[CURLOPT_HTTPHEADER][] = 'Expect:'; |
219 | 219 | } |
220 | 220 | |
221 | 221 | // cURL sometimes adds a content-type by default. Prevent this. |
222 | - if (!$this->request->hasHeader('Content-Type')) { |
|
222 | + if(!$this->request->hasHeader('Content-Type')){ |
|
223 | 223 | $options[CURLOPT_HTTPHEADER][] = 'Content-Type:'; |
224 | 224 | } |
225 | 225 |
@@ -214,12 +214,12 @@ |
||
214 | 214 | $options[CURLOPT_HTTPHEADER] = $curlHeaders; |
215 | 215 | |
216 | 216 | // If the Expect header is not present, prevent curl from adding it |
217 | - if (!$this->request->hasHeader('Expect')) { |
|
217 | + if (!$this->request->hasHeader('Expect')){ |
|
218 | 218 | $options[CURLOPT_HTTPHEADER][] = 'Expect:'; |
219 | 219 | } |
220 | 220 | |
221 | 221 | // cURL sometimes adds a content-type by default. Prevent this. |
222 | - if (!$this->request->hasHeader('Content-Type')) { |
|
222 | + if (!$this->request->hasHeader('Content-Type')){ |
|
223 | 223 | $options[CURLOPT_HTTPHEADER][] = 'Content-Type:'; |
224 | 224 | } |
225 | 225 |
@@ -44,7 +44,7 @@ |
||
44 | 44 | /** |
45 | 45 | * @param string $endpointMap |
46 | 46 | * |
47 | - * @return \chillerlan\HTTP\MagicAPI\ApiClientInterface |
|
47 | + * @return ApiClientTrait |
|
48 | 48 | * @throws \chillerlan\HTTP\MagicAPI\ApiClientException |
49 | 49 | */ |
50 | 50 | public function loadEndpoints(string $endpointMap):ApiClientInterface{ |
@@ -12,10 +12,10 @@ |
||
12 | 12 | |
13 | 13 | namespace chillerlan\HTTP\MagicAPI; |
14 | 14 | |
15 | -use chillerlan\HTTP\Psr7; |
|
16 | 15 | use Psr\Http\Message\ResponseInterface; |
17 | 16 | use Psr\Log\LoggerInterface; |
18 | 17 | use ReflectionClass; |
18 | +use chillerlan\HTTP\Psr7; |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * @link http://php.net/manual/language.oop5.magic.php#118617 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | * @see http://php.net/manual/features.file-upload.post-method.php |
27 | 27 | * @see http://php.net/manual/features.file-upload.errors.php |
28 | 28 | * |
29 | - * @param StreamInterface $stream Underlying stream representing the |
|
29 | + * @param \Psr\Http\Message\StreamInterface $stream Underlying stream representing the |
|
30 | 30 | * uploaded file content. |
31 | 31 | * @param int $size in bytes |
32 | 32 | * @param int $error PHP file upload error |
@@ -203,7 +203,7 @@ |
||
203 | 203 | * |
204 | 204 | * @author Michael Dowling and contributors to guzzlehttp/psr7 |
205 | 205 | * |
206 | - * @param StreamInterface $dest Stream to write to |
|
206 | + * @param \Psr\Http\Message\StreamInterface $dest Stream to write to |
|
207 | 207 | * |
208 | 208 | * @throws \RuntimeException on error |
209 | 209 | */ |
@@ -12,9 +12,9 @@ |
||
12 | 12 | |
13 | 13 | namespace chillerlan\HTTP\Psr7; |
14 | 14 | |
15 | +use InvalidArgumentException; |
|
15 | 16 | use chillerlan\HTTP\Psr17; |
16 | 17 | use chillerlan\HTTP\Psr17\StreamFactory; |
17 | -use InvalidArgumentException; |
|
18 | 18 | use Psr\Http\Message\{StreamInterface, UploadedFileInterface}; |
19 | 19 | use RuntimeException; |
20 | 20 |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | /** |
157 | 157 | * @inheritdoc |
158 | 158 | */ |
159 | - public function getSize():?int{ |
|
159 | + public function getSize(): ?int{ |
|
160 | 160 | return $this->size; |
161 | 161 | } |
162 | 162 | |
@@ -170,14 +170,14 @@ discard block |
||
170 | 170 | /** |
171 | 171 | * @inheritdoc |
172 | 172 | */ |
173 | - public function getClientFilename():?string{ |
|
173 | + public function getClientFilename(): ?string{ |
|
174 | 174 | return $this->clientFilename; |
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
178 | 178 | * @inheritdoc |
179 | 179 | */ |
180 | - public function getClientMediaType():?string{ |
|
180 | + public function getClientMediaType(): ?string{ |
|
181 | 181 | return $this->clientMediaType; |
182 | 182 | } |
183 | 183 |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | * @return int|null |
308 | 308 | * @throws \InvalidArgumentException |
309 | 309 | */ |
310 | - private function filterPort($port):?int{ |
|
310 | + private function filterPort($port): ?int{ |
|
311 | 311 | |
312 | 312 | if($port === null){ |
313 | 313 | return null; |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | /** |
326 | 326 | * @inheritdoc |
327 | 327 | */ |
328 | - public function getPort():?int{ |
|
328 | + public function getPort(): ?int{ |
|
329 | 329 | return $this->port; |
330 | 330 | } |
331 | 331 |
@@ -169,7 +169,7 @@ |
||
169 | 169 | /** |
170 | 170 | * @inheritdoc |
171 | 171 | */ |
172 | - public function getSize():?int{ |
|
172 | + public function getSize(): ?int{ |
|
173 | 173 | |
174 | 174 | if($this->size !== null){ |
175 | 175 | return $this->size; |