CodeExplorer shiftBaseUri example
unset($options['max_retries'
]);
$clone->client =
$this->client->
withOptions($options);
return $clone;
} public function request(string
$method, string
$url, array
$options =
[]): ResponseInterface
{ $baseUris = \
array_key_exists('base_uri',
$options) ?
$options['base_uri'
] :
$this->baseUris;
$baseUris = \
is_array($baseUris) ?
$baseUris :
[];
$options = self::
shiftBaseUri($options,
$baseUris);
$maxRetries =
(int) ($options['max_retries'
] ??
$this->maxRetries
);
unset($options['max_retries'
]);
if ($maxRetries <= 0
) { return new AsyncResponse($this->client,
$method,
$url,
$options);
} return new AsyncResponse($this->client,
$method,
$url,
$options,
function DChunkInterface
$chunk, AsyncContext
$context) use ($method,
$url,
$options,
$maxRetries, &
$baseUris) { static $retryCount = 0;
static $content = '';