Skip to content

Commit 50aa1c3

Browse files
committed
Add a few more ??=
1 parent 6bfe209 commit 50aa1c3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Internal/AmpListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct(array &$info, array $pinSha256, \Closure $onProgress
5050

5151
public function startRequest(Request $request): Promise
5252
{
53-
$this->info['start_time'] = $this->info['start_time'] ?? microtime(true);
53+
$this->info['start_time'] ??= microtime(true);
5454
($this->onProgress)();
5555

5656
return new Success();

Internal/CurlClientState.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ final class CurlClientState extends ClientState
3838

3939
public function __construct(int $maxHostConnections, int $maxPendingPushes)
4040
{
41-
self::$curlVersion = self::$curlVersion ?? curl_version();
41+
self::$curlVersion ??= curl_version();
4242

4343
$this->handle = curl_multi_init();
4444
$this->dnsCache = new DnsCache();

Response/CurlResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function __construct(CurlClientState $multi, \CurlHandle|string $ch, arra
6868
$this->info['http_method'] = $method;
6969
$this->info['user_data'] = $options['user_data'] ?? null;
7070
$this->info['max_duration'] = $options['max_duration'] ?? null;
71-
$this->info['start_time'] = $this->info['start_time'] ?? microtime(true);
71+
$this->info['start_time'] ??= microtime(true);
7272
$this->info['original_url'] = $originalUrl ?? $this->info['url'] ?? curl_getinfo($ch, \CURLINFO_EFFECTIVE_URL);
7373
$info = &$this->info;
7474
$headers = &$this->headers;

0 commit comments

Comments
 (0)