8000 fix PHP 7.2 compatibility · symfony/http-client@11f6f8a · GitHub
[go: up one dir, main page]

Skip to content

Commit 11f6f8a

Browse files
committed
fix PHP 7.2 compatibility
1 parent 3b643b8 commit 11f6f8a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

NoPrivateNetworkHttpClient.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ public function request(string $method, string $url, array $options = []): Respo
8383
$options['on_progress'] = function (int $dlNow, int $dlSize, array $info, ?\Closure $resolve = null) use ($onProgress, $subnets, &$lastUrl, &$lastPrimaryIp): void {
8484
if ($info['url'] !== $lastUrl) {
8585
$host = trim(parse_url($info['url'], PHP_URL_HOST) ?: '', '[]');
86-
$resolve ??= static fn () => null;
86+
87+
if (null === $resolve) {
88+
$resolve = static function () { return null; };
89+
}
8790

8891
if (($ip = $host)
8992
&& !filter_var($ip, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)

0 commit comments

Comments
 (0)
0