@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * Creates a middleware that updates a command with the content and tree |
| 117 | 117 | * hash headers for upload operations. |
| 118 | 118 | * |
| 119 | - * @return callable |
|
| 119 | + * @return \Closure |
|
| 120 | 120 | * @throws CouldNotCreateChecksumException if the body is not seekable. |
| 121 | 121 | */ |
| 122 | 122 | private function getChecksumsMiddleware() |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | /** |
| 189 | 189 | * Creates a middleware that adds the API version header for all requests. |
| 190 | 190 | * |
| 191 | - * @return callable |
|
| 191 | + * @return \Closure |
|
| 192 | 192 | */ |
| 193 | 193 | private function getApiVersionMiddleware() |
| 194 | 194 | { |
@@ -86,6 +86,9 @@ discard block |
||
| 86 | 86 | ); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | + /** |
|
| 90 | + * @return Psr7Request |
|
| 91 | + */ |
|
| 89 | 92 | private function createGuzzleRequest(Psr7Request $psrRequest, array $options) |
| 90 | 93 | { |
| 91 | 94 | $ringConfig = []; |
@@ -128,6 +131,10 @@ discard block |
||
| 128 | 131 | if (is_callable($statsCallback)) { |
| 129 | 132 | $request->getEmitter()->on( |
| 130 | 133 | 'end', |
| 134 | + |
|
| 135 | + /** |
|
| 136 | + * @return Psr7Request |
|
| 137 | + */ |
|
| 131 | 138 | function (EndEvent $event) use ($statsCallback) { |
| 132 | 139 | $statsCallback($event->getTransferInfo()); |
| 133 | 140 | } |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Aws\Handler\GuzzleV5; |
| 3 | 3 | |
| 4 | -use Aws\Sdk; |
|
| 5 | 4 | use Exception; |
| 6 | 5 | use GuzzleHttp\Client; |
| 7 | 6 | use GuzzleHttp\ClientInterface; |
@@ -292,10 +292,10 @@ discard block |
||
| 292 | 292 | /** |
| 293 | 293 | * Splices a function into the middleware list at a specific position. |
| 294 | 294 | * |
| 295 | - * @param $findName |
|
| 296 | - * @param $withName |
|
| 295 | + * @param callable $findName |
|
| 296 | + * @param string $withName |
|
| 297 | 297 | * @param callable $middleware |
| 298 | - * @param $before |
|
| 298 | + * @param boolean $before |
|
| 299 | 299 | */ |
| 300 | 300 | private function splice($findName, $withName, callable $middleware, $before) |
| 301 | 301 | { |
@@ -368,6 +368,9 @@ discard block |
||
| 368 | 368 | } |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | + /** |
|
| 372 | + * @param string $name |
|
| 373 | + */ |
|
| 371 | 374 | private function removeByName($name) |
| 372 | 375 | { |
| 373 | 376 | if (!isset($this->named[$name])) { |
@@ -379,6 +382,10 @@ discard block |
||
| 379 | 382 | $this->steps[$step] = array_values( |
| 380 | 383 | array_filter( |
| 381 | 384 | $this->steps[$step], |
| 385 | + |
|
| 386 | + /** |
|
| 387 | + * @param string $tuple |
|
| 388 | + */ |
|
| 382 | 389 | function ($tuple) use ($name) { |
| 383 | 390 | return $tuple[1] !== $name; |
| 384 | 391 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | * @param \Aws\Api\Service $service |
| 34 | 34 | * @param callable|null $bytesGenerator |
| 35 | 35 | * |
| 36 | - * @return callable |
|
| 36 | + * @return \Closure |
|
| 37 | 37 | */ |
| 38 | 38 | public static function wrap( |
| 39 | 39 | Service $service, |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | /** |
| 100 | 100 | * This function decides the PHP function used in generating random bytes. |
| 101 | 101 | * |
| 102 | - * @return callable|null |
|
| 102 | + * @return string|null |
|
| 103 | 103 | */ |
| 104 | 104 | private function findCompatibleRandomSource() |
| 105 | 105 | { |
@@ -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 | { |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use GuzzleHttp\Psr7; |
| 10 | 10 | use GuzzleHttp\Psr7\LazyOpenStream; |
| 11 | 11 | use Psr\Http\Message\RequestInterface; |
| 12 | -use Psr\Http\Message\ResponseInterface; |
|
| 13 | 12 | |
| 14 | 13 | final class Middleware |
| 15 | 14 | { |
@@ -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 | { |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | use Aws\ResultInterface; |
| 11 | 11 | use GuzzleHttp\Promise; |
| 12 | 12 | use GuzzleHttp\Promise\PromiseInterface; |
| 13 | -use GuzzleHttp\Psr7; |
|
| 14 | 13 | use InvalidArgumentException as IAE; |
| 15 | 14 | use Psr\Http\Message\RequestInterface; |
| 16 | 15 | |
@@ -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'])) { |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use Psr\Http\Message\RequestInterface; |
| 7 | 7 | use GuzzleHttp\Promise; |
| 8 | 8 | use GuzzleHttp\Promise\PromiseInterface; |
| 9 | -use GuzzleHttp\Psr7; |
|
| 10 | 9 | |
| 11 | 10 | /** |
| 12 | 11 | * @internal Middleware that retries failures. |
@@ -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(); |
@@ -15,7 +15,6 @@ |
||
| 15 | 15 | use Aws\CommandInterface; |
| 16 | 16 | use GuzzleHttp\Exception\RequestException; |
| 17 | 17 | use GuzzleHttp\Promise; |
| 18 | -use GuzzleHttp\Psr7; |
|
| 19 | 18 | use Psr\Http\Message\RequestInterface; |
| 20 | 19 | |
| 21 | 20 | /** |