@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @param string $bodyParameter |
22 | 22 | * @param string $sourceParameter |
23 | 23 | * |
24 | - * @return callable |
|
24 | + * @return \Closure |
|
25 | 25 | */ |
26 | 26 | public static function sourceFile( |
27 | 27 | Service $api, |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @param Service $api API being accessed. |
64 | 64 | * |
65 | - * @return callable |
|
65 | + * @return \Closure |
|
66 | 66 | */ |
67 | 67 | public static function validation(Service $api, Validator $validator = null) |
68 | 68 | { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * |
89 | 89 | * @param callable $serializer Function used to serialize a request for a |
90 | 90 | * command. |
91 | - * @return callable |
|
91 | + * @return \Closure |
|
92 | 92 | */ |
93 | 93 | public static function requestBuilder(callable $serializer) |
94 | 94 | { |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * object and returns a |
110 | 110 | * SignatureInterface. |
111 | 111 | * |
112 | - * @return callable |
|
112 | + * @return \Closure |
|
113 | 113 | */ |
114 | 114 | public static function signer(callable $credProvider, callable $signatureFunction) |
115 | 115 | { |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | * |
143 | 143 | * @param callable $fn Tap function |
144 | 144 | * |
145 | - * @return callable |
|
145 | + * @return \Closure |
|
146 | 146 | */ |
147 | 147 | public static function tap(callable $fn) |
148 | 148 | { |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * @param bool $stats Whether to collect statistics on retries and the |
173 | 173 | * associated delay. |
174 | 174 | * |
175 | - * @return callable |
|
175 | + * @return \Closure |
|
176 | 176 | */ |
177 | 177 | public static function retry( |
178 | 178 | callable $decider = null, |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | * This is a uniquely generated UUID to identify initial and subsequent |
194 | 194 | * retries as part of a complete request lifecycle. |
195 | 195 | * |
196 | - * @return callable |
|
196 | + * @return \Closure |
|
197 | 197 | */ |
198 | 198 | public static function invocationId() |
199 | 199 | { |
@@ -215,9 +215,9 @@ discard block |
||
215 | 215 | * request body's URI is available. It then checks the file extension of the |
216 | 216 | * URI to determine the mime-type. |
217 | 217 | * |
218 | - * @param array $operations Operations that Content-Type should be added to. |
|
218 | + * @param string[] $operations Operations that Content-Type should be added to. |
|
219 | 219 | * |
220 | - * @return callable |
|
220 | + * @return \Closure |
|
221 | 221 | */ |
222 | 222 | public static function contentType(array $operations) |
223 | 223 | { |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | * |
249 | 249 | * @param History $history History container to store entries. |
250 | 250 | * |
251 | - * @return callable |
|
251 | + * @return \Closure |
|
252 | 252 | */ |
253 | 253 | public static function history(History $history) |
254 | 254 | { |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | * @param callable $f Map function that accepts a RequestInterface and |
281 | 281 | * returns a RequestInterface. |
282 | 282 | * |
283 | - * @return callable |
|
283 | + * @return \Closure |
|
284 | 284 | */ |
285 | 285 | public static function mapRequest(callable $f) |
286 | 286 | { |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | * @param callable $f Map function that accepts a command and returns a |
302 | 302 | * command. |
303 | 303 | * |
304 | - * @return callable |
|
304 | + * @return \Closure |
|
305 | 305 | */ |
306 | 306 | public static function mapCommand(callable $f) |
307 | 307 | { |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | * @param callable $f Map function that accepts an Aws\ResultInterface and |
322 | 322 | * returns an Aws\ResultInterface. |
323 | 323 | * |
324 | - * @return callable |
|
324 | + * @return \Closure |
|
325 | 325 | */ |
326 | 326 | public static function mapResult(callable $f) |
327 | 327 | { |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * Based on the config and service-specific workflow info, creates a |
197 | 197 | * `Promise` for an `UploadState` object. |
198 | 198 | * |
199 | - * @return PromiseInterface A `Promise` that resolves to an `UploadState`. |
|
199 | + * @return UploadState A `Promise` that resolves to an `UploadState`. |
|
200 | 200 | */ |
201 | 201 | private function determineState() |
202 | 202 | { |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | * |
260 | 260 | * @param array $errors Errors from upload operations are added to this. |
261 | 261 | * |
262 | - * @return callable |
|
262 | + * @return \Closure |
|
263 | 263 | */ |
264 | 264 | private function getResultHandler(&$errors = []) |
265 | 265 | { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * |
54 | 54 | * @param int $maxRetries |
55 | 55 | * |
56 | - * @return callable |
|
56 | + * @return \Closure |
|
57 | 57 | */ |
58 | 58 | public static function createDefaultDecider($maxRetries = 3) |
59 | 59 | { |
@@ -159,11 +159,17 @@ discard block |
||
159 | 159 | return $handler($command, $request)->then($g, $g); |
160 | 160 | } |
161 | 161 | |
162 | + /** |
|
163 | + * @param integer $retries |
|
164 | + */ |
|
162 | 165 | private function addRetryHeader($request, $retries, $delayBy) |
163 | 166 | { |
164 | 167 | return $request->withHeader('aws-sdk-retry', "{$retries}/{$delayBy}"); |
165 | 168 | } |
166 | 169 | |
170 | + /** |
|
171 | + * @param integer $retries |
|
172 | + */ |
|
167 | 173 | private function updateStats($retries, $delay, array &$stats) |
168 | 174 | { |
169 | 175 | if (!isset($stats['total_retry_delay'])) { |
@@ -105,6 +105,10 @@ |
||
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | + /** |
|
109 | + * @param integer $partNumber |
|
110 | + * @param double $partsCount |
|
111 | + */ |
|
108 | 112 | private function createPart($partNumber, $partsCount) |
109 | 113 | { |
110 | 114 | $defaultPartSize = $this->determinePartSize(); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @param string $region |
48 | 48 | * @param array $options |
49 | 49 | * |
50 | - * @return callable |
|
50 | + * @return \Closure |
|
51 | 51 | */ |
52 | 52 | public static function wrap($region, array $options) |
53 | 53 | { |
@@ -56,6 +56,9 @@ discard block |
||
56 | 56 | }; |
57 | 57 | } |
58 | 58 | |
59 | + /** |
|
60 | + * @param string $region |
|
61 | + */ |
|
59 | 62 | public function __construct( |
60 | 63 | callable $nextHandler, |
61 | 64 | $region, |
@@ -150,6 +153,11 @@ discard block |
||
150 | 153 | && S3Client::isBucketDnsCompatible($command['Bucket']); |
151 | 154 | } |
152 | 155 | |
156 | + /** |
|
157 | + * @param string $host |
|
158 | + * |
|
159 | + * @return string |
|
160 | + */ |
|
153 | 161 | private function getBucketStyleHost(CommandInterface $command, $host) |
154 | 162 | { |
155 | 163 | // For operations on the base host (e.g. ListBuckets) |
@@ -195,11 +203,17 @@ discard block |
||
195 | 203 | return $request; |
196 | 204 | } |
197 | 205 | |
206 | + /** |
|
207 | + * @return string |
|
208 | + */ |
|
198 | 209 | private function getDualStackHost() |
199 | 210 | { |
200 | 211 | return "s3.dualstack.{$this->region}.amazonaws.com"; |
201 | 212 | } |
202 | 213 | |
214 | + /** |
|
215 | + * @param string $pattern |
|
216 | + */ |
|
203 | 217 | private function applyAccelerateEndpoint( |
204 | 218 | CommandInterface $command, |
205 | 219 | RequestInterface $request, |
@@ -216,11 +230,19 @@ discard block |
||
216 | 230 | return $request; |
217 | 231 | } |
218 | 232 | |
233 | + /** |
|
234 | + * @return string |
|
235 | + */ |
|
219 | 236 | private function getAccelerateHost(CommandInterface $command, $pattern) |
220 | 237 | { |
221 | 238 | return "{$command['Bucket']}.{$pattern}.amazonaws.com"; |
222 | 239 | } |
223 | 240 | |
241 | + /** |
|
242 | + * @param string $path |
|
243 | + * |
|
244 | + * @return string |
|
245 | + */ |
|
224 | 246 | private function getBucketlessPath($path, CommandInterface $command) |
225 | 247 | { |
226 | 248 | $pattern = '/^\\/' . preg_quote($command['Bucket'], '/') . '/'; |
@@ -286,6 +286,9 @@ |
||
286 | 286 | }); |
287 | 287 | } |
288 | 288 | |
289 | + /** |
|
290 | + * @return string |
|
291 | + */ |
|
289 | 292 | private function getCacheKey($bucketName) |
290 | 293 | { |
291 | 294 | return "aws:s3:{$bucketName}:location"; |
@@ -205,6 +205,9 @@ discard block |
||
205 | 205 | return $this->body->write($data); |
206 | 206 | } |
207 | 207 | |
208 | + /** |
|
209 | + * @param string $path |
|
210 | + */ |
|
208 | 211 | public function unlink($path) |
209 | 212 | { |
210 | 213 | $this->initProtocol($path); |
@@ -263,6 +266,9 @@ discard block |
||
263 | 266 | $this->protocol = $parts[0] ?: 's3'; |
264 | 267 | } |
265 | 268 | |
269 | + /** |
|
270 | + * @param string $path |
|
271 | + */ |
|
266 | 272 | private function createStat($path, $flags) |
267 | 273 | { |
268 | 274 | $this->initProtocol($path); |
@@ -442,7 +448,7 @@ discard block |
||
442 | 448 | /** |
443 | 449 | * This method is called in response to rewinddir() |
444 | 450 | * |
445 | - * @return boolean true on success |
|
451 | + * @return boolean|null true on success |
|
446 | 452 | */ |
447 | 453 | public function dir_rewinddir() |
448 | 454 | { |
@@ -558,6 +564,7 @@ discard block |
||
558 | 564 | /** |
559 | 565 | * Validates the provided stream arguments for fopen and returns an array |
560 | 566 | * of errors. |
567 | + * @param string $mode |
|
561 | 568 | */ |
562 | 569 | private function validate($path, $mode) |
563 | 570 | { |
@@ -214,6 +214,9 @@ discard block |
||
214 | 214 | return rtrim(str_replace('\\', '/', $path), '/'); |
215 | 215 | } |
216 | 216 | |
217 | + /** |
|
218 | + * @param string $uri |
|
219 | + */ |
|
217 | 220 | private function resolveUri($uri) |
218 | 221 | { |
219 | 222 | $resolved = []; |
@@ -380,6 +383,9 @@ discard block |
||
380 | 383 | return $relative_file_path; |
381 | 384 | } |
382 | 385 | |
386 | + /** |
|
387 | + * @param resource $debug |
|
388 | + */ |
|
383 | 389 | private function addDebugToBefore($debug) |
384 | 390 | { |
385 | 391 | $before = $this->before; |
@@ -174,6 +174,12 @@ |
||
174 | 174 | return '/' . str_replace('%2F', '/', $doubleEncoded); |
175 | 175 | } |
176 | 176 | |
177 | + /** |
|
178 | + * @param string $longDate |
|
179 | + * @param string $creq |
|
180 | + * |
|
181 | + * @return string |
|
182 | + */ |
|
177 | 183 | private function createStringToSign($longDate, $credentialScope, $creq) |
178 | 184 | { |
179 | 185 | $hash = hash('sha256', $creq); |