8000 [HttpClient] apply suggested changes from review · symfony/symfony@9223c1b · GitHub
[go: up one dir, main page]

Skip to content

Commit 9223c1b

Browse files
committed
[HttpClient] apply suggested changes from review
1 parent 5cabb55 commit 9223c1b

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/Symfony/Component/HttpClient/CurlHttpClient.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function request(string $method, string $url, array $options = []): Respo
9595
$scheme = $url['scheme'];
9696
$authority = $url['authority'];
9797
$host = parse_url($authority, \PHP_URL_HOST);
98-
$proxy = self::getProxyURL($options['proxy'], $url);
98+
$proxy = self::getProxyUrl($options['proxy'], $url);
9999
$url = implode('', $url);
100100

101101
if (!isset($options['normalized_headers']['user-agent'])) {
@@ -408,7 +408,7 @@ private static function createRedirectResolver(array $options, string $host): \C
408408
}
409409
}
410410

411-
return static function ($ch, string $location, bool $noContent) use (&$redirectHeaders, &$options) {
411+
return static function ($ch, string $location, bool $noContent) use (&$redirectHeaders, $options) {
412412
try {
413413
$location = self::parseUrl($location);
414414
} catch (InvalidArgumentException $e) {
@@ -433,7 +433,7 @@ private static function createRedirectResolver(array $options, string $host): \C
433433
$url = self::parseUrl(curl_getinfo($ch, \CURLINFO_EFFECTIVE_URL));
434434
$url = self::resolveUrl($location, $url);
435435

436-
curl_setopt($ch, \CURLOPT_PROXY, self::getProxyURL($options['proxy'], $url));
436+
curl_setopt($ch, \CURLOPT_PROXY, self::getProxyUrl($options['proxy'], $url));
437437

438438
return implode('', $url);
439439
};

src/Symfony/Component/HttpClient/HttpClientTrait.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,9 +655,7 @@ private static function mergeQueryString(?string $queryString, array $queryArray
655655
*/
656656
private static function getProxy(?string $proxy, array $url, ?string $noProxy): ?array
657657
{
658-
$proxy = self::getProxyURL($proxy, $url);
659-
660-
if (null === $proxy) {
658+
if (null === $proxy = self::getProxyUrl($proxy, $url)) {
661659
return null;
662660
}
663661

@@ -685,7 +683,7 @@ private static function getProxy(?string $proxy, array $url, ?string $noProxy):
685683
];
686684
}
687685

688-
private static function getProxyURL(?string $proxy, array $url): ?string
686+
private static function getProxyUrl(?string $proxy, array $url): ?string
689687
{
690688
if (null !== $proxy) {
691689
return $proxy;

0 commit comments

Comments
 (0)
0