Skip to content

Commit 83359cc

Browse files
wouterjnicolas-grekas
authored andcommitted
Add void return types
1 parent 0b1feaa commit 83359cc

17 files changed

+28
-16
lines changed

AmpHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function stream(ResponseInterface|iterable $responses, float $timeout = n
153153
return new ResponseStream(AmpResponse::stream($responses, $timeout));
154154
}
155155

156-
public function reset()
156+
public function reset(): void
157157
{
158158
$this->multi->dnsCache = [];
159159

CachingHttpClient.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ public function stream(ResponseInterface|iterable $responses, float $timeout = n
135135
})());
136136
}
137137

138+
/**
139+
* @return void
140+
*/
138141
public function reset()
139142
{
140143
if ($this->client instanceof ResetInterface) {

CurlHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public function stream(ResponseInterface|iterable $responses, float $timeout = n
324324
return new ResponseStream(CurlResponse::stream($responses, $timeout));
325325
}
326326

327-
public function reset()
327+
public function reset(): void
328328
{
329329
$this->multi->reset();
330330
}

DataCollector/HttpClientDataCollector.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ final class HttpClientDataCollector extends DataCollector implements LateDataCol
3131
*/
3232
private array $clients = [];
3333

34-
public function registerClient(string $name, TraceableHttpClient $client)
34+
public function registerClient(string $name, TraceableHttpClient $client): void
3535
{
3636
$this->clients[$name] = $client;
3737
}
3838

39-
public function collect(Request $request, Response $response, \Throwable $exception = null)
39+
public function collect(Request $request, Response $response, \Throwable $exception = null): void
4040
{
4141
$this->lateCollect();
4242
}
4343

44-
public function lateCollect()
44+
public function lateCollect(): void
4545
{
4646
$this->data['request_count'] = $this->data['request_count'] ?? 0;
4747
$this->data['error_count'] = $this->data['error_count'] ?? 0;
@@ -86,7 +86,7 @@ public function getName(): string
8686
return 'http_client';
8787
}
8888

89-
public function reset()
89+
public function reset(): void
9090
{
9191
$this->data = [
9292
'clients' => [],

DecoratorTrait.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ public function withOptions(array $options): static
4848
return $clone;
4949
}
5050

51+
/**
52+
* @return void
53+
*/
5154
public function reset()
5255
{
5356
if ($this->client instanceof ResetInterface) {

DependencyInjection/HttpClientPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
final class HttpClientPass implements CompilerPassInterface
2121
{
22-
public function process(ContainerBuilder $container)
22+
public function process(ContainerBuilder $container): void
2323
{
2424
if (!$container->hasDefinition('data_collector.http_client')) {
2525
return;

HttplugClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public function __destruct()
266266
$this->wait();
267267
}
268268

269-
public function reset()
269+
public function reset(): void
270270
{
271271
if ($this->client instanceof ResetInterface) {
272272
$this->client->reset();

Internal/Canary.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct(\Closure $canceller)
2525
$this->canceller = $canceller;
2626
}
2727

28-
public function cancel()
28+
public function cancel(): void
2929
{
3030
if (isset($this->canceller)) {
3131
$canceller = $this->canceller;

Internal/CurlClientState.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function __construct(int $maxHostConnections, int $maxPendingPushes)
7777
curl_multi_setopt($this->handle, \CURLMOPT_PUSHFUNCTION, static fn ($parent, $pushed, array $requestHeaders) => $multi->handlePush($parent, $pushed, $requestHeaders, $maxPendingPushes));
7878
}
7979

80-
public function reset()
80+
public function reset(): void
8181
{
8282
foreach ($this->pushedResponses as $url => $response) {
8383
$this->logger?->debug(sprintf('Unused pushed response: "%s"', $url));

Internal/NativeClientState.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct()
3434
$this->id = random_int(\PHP_INT_MIN, \PHP_INT_MAX);
3535
}
3636

37-
public function reset()
37+
public function reset(): void
3838
{
3939
$this->responseCount = 0;
4040
$this->dnsCache = [];

0 commit comments

Comments
 (0)