Skip to content

Commit 650a635

Browse files
CS fixes
1 parent cc73b44 commit 650a635

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

AmpHttpClient.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ public function request(string $method, string $url, array $options = []): Respo
111111
$request = new Request(implode('', $url), $method);
112112

113113
if ($options['http_version']) {
114-
switch ((float) $options['http_version']) {
115-
case 1.0: $request->setProtocolVersions(['1.0']); break;
116-
case 1.1: $request->setProtocolVersions(['1.1', '1.0']); break;
117-
default: $request->setProtocolVersions(['2', '1.1', '1.0']); break;
118-
}
114+
$request->setProtocolVersions(match ((float) $options['http_version']) {
115+
1.0 => ['1.0'],
116+
1.1 => $request->setProtocolVersions(['1.1', '1.0']),
117+
default => ['2', '1.1', '1.0'],
118+
});
119119
}
120120

121121
foreach ($options['headers'] as $v) {

0 commit comments

Comments
 (0)