final protected function getHttpClient(): ClientInterface
{
if (!$this->httpClient) {
- $this->httpClient = HttpFactory::makeClient([
- RequestOptions::TIMEOUT => 5,
- ]);
+ $this->httpClient = HttpFactory::makeClientWithTimeout(5);
}
return $this->httpClient;
// download image
try {
- $client = HttpFactory::makeClient([
- RequestOptions::TIMEOUT => 10,
- ]);
+ $client = HttpFactory::makeClientWithTimeout(10);
$request = new Request('GET', $url, [
'via' => '1.1 wsc',
'accept' => 'image/*',
$extension = \pathinfo(Url::parse($rank->rankImage)['path'], \PATHINFO_EXTENSION);
if (\in_array($extension, ['gif', 'png', 'jpg', 'jpeg', 'svg', 'webp'])) {
- $http = HttpFactory::makeClient([
- RequestOptions::TIMEOUT => 10,
- ]);
+ $http = HttpFactory::makeClientWithTimeout(10);
$imageDest = WCF_DIR . UserRank::RANK_IMAGE_DIR . $rank->rankID . '-rankImage.' . $extension;
$http->send(new Request('GET', $rank->rankImage), [