Skip to content

Commit 5b7fa7e

Browse files
Merge branch '5.4' into 6.3
* 5.4: Fix implicitly-required parameters List CS fix in .git-blame-ignore-revs Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2 parents 2f44f1d + 5777997 commit 5b7fa7e

32 files changed

+52
-52
lines changed

AmpHttpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ final class AmpHttpClient implements HttpClientInterface, LoggerAwareInterface,
6464
*
6565
* @see HttpClientInterface::OPTIONS_DEFAULTS for available options
6666
*/
67-
public function __construct(array $defaultOptions = [], callable $clientConfigurator = null, int $maxHostConnections = 6, int $maxPendingPushes = 50)
67+
public function __construct(array $defaultOptions = [], ?callable $clientConfigurator = null, int $maxHostConnections = 6, int $maxPendingPushes = 50)
6868
{
6969
$this->defaultOptions['buffer'] ??= self::shouldBuffer(...);
7070

@@ -148,7 +148,7 @@ public function request(string $method, string $url, array $options = []): Respo
148148
return new AmpResponse($this->multi, $request, $options, $this->logger);
149149
}
150150

151-
public function stream(ResponseInterface|iterable $responses, float $timeout = null): ResponseStreamInterface
151+
public function stream(ResponseInterface|iterable $responses, ?float $timeout = null): ResponseStreamInterface
152152
{
153153
if ($responses instanceof AmpResponse) {
154154
$responses = [$responses];

AsyncDecoratorTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ trait AsyncDecoratorTrait
3030
*/
3131
abstract public function request(string $method, string $url, array $options = []): ResponseInterface;
3232

33-
public function stream(ResponseInterface|iterable $responses, float $timeout = null): ResponseStreamInterface
33+
public function stream(ResponseInterface|iterable $responses, ?float $timeout = null): ResponseStreamInterface
3434
{
3535
if ($responses instanceof AsyncResponse) {
3636
$responses = [$responses];

CachingHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function request(string $method, string $url, array $options = []): Respo
105105
return MockResponse::fromRequest($method, $url, $options, $response);
106106
}
107107

108-
public function stream(ResponseInterface|iterable $responses, float $timeout = null): ResponseStreamInterface
108+
public function stream(ResponseInterface|iterable $responses, ?float $timeout = null): ResponseStreamInterface
109109
{
110110
if ($responses instanceof ResponseInterface) {
111111
$responses = [$responses];

Chunk/ErrorChunk.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function getError(): ?string
8484
return $this->errorMessage;
8585
}
8686

87-
public function didThrow(bool $didThrow = null): bool
87+
public function didThrow(?bool $didThrow = null): bool
8888
{
8989
if (null !== $didThrow && $this->didThrow !== $didThrow) {
9090
return !$this->didThrow = $didThrow;

CurlHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ public function request(string $method, string $url, array $options = []): Respo
317317
return $pushedResponse ?? new CurlResponse($this->multi, $ch, $options, $this->logger, $method, self::createRedirectResolver($options, $host, $port), CurlClientState::$curlVersion['version_number'], $url);
318318
}
319319

320-
public function stream(ResponseInterface|iterable $responses, float $timeout = null): ResponseStreamInterface
320+
public function stream(ResponseInterface|iterable $responses, ?float $timeout = null): ResponseStreamInterface
321321
{
322322
if ($responses instanceof CurlResponse) {
323323
$responses = [$responses];

DataCollector/HttpClientDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function registerClient(string $name, TraceableHttpClient $client): void
3838
$this->clients[$name] = $client;
3939
}
4040

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

DecoratorTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ trait DecoratorTrait
2525
{
2626
private HttpClientInterface $client;
2727

28-
public function __construct(HttpClientInterface $client = null)
28+
public function __construct(?HttpClientInterface $client = null)
2929
{
3030
$this->client = $client ?? HttpClient::create();
3131
}
@@ -35,7 +35,7 @@ public function request(string $method, string $url, array $options = []): Respo
3535
return $this->client->request($method, $url, $options);
3636
}
3737

38-
public function stream(ResponseInterface|iterable $responses, float $timeout = null): ResponseStreamInterface
38+
public function stream(ResponseInterface|iterable $responses, ?float $timeout = null): ResponseStreamInterface
3939
{
4040
return $this->client->stream($responses, $timeout);
4141
}

EventSourceHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class EventSourceHttpClient implements HttpClientInterface, ResetInterface
3333

3434
private float $reconnectionTime;
3535

36-
public function __construct(HttpClientInterface $client = null, float $reconnectionTime = 10.0)
36+
public function __construct(?HttpClientInterface $client = null, float $reconnectionTime = 10.0)
3737
{
3838
$this->client = $client ?? HttpClient::create();
3939
$this->reconnectionTime = $reconnectionTime;

HttpClientTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ private static function normalizePeerFingerprint(mixed $fingerprint): array
535535
/**
536536
* @throws InvalidArgumentException When the value cannot be json-encoded
537537
*/
538-
private static function jsonEncode(mixed $value, int $flags = null, int $maxDepth = 512): string
538+
private static function jsonEncode(mixed $value, ?int $flags = null, int $maxDepth = 512): string
539539
{
540540
$flags ??= \JSON_HEX_TAG | \JSON_HEX_APOS | \JSON_HEX_AMP | \JSON_HEX_QUOT | \JSON_PRESERVE_ZERO_FRACTION;
541541

HttplugClient.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ final class HttplugClient implements ClientInterface, HttpAsyncClient, RequestFa
7070

7171
private HttplugWaitLoop $waitLoop;
7272

73-
public function __construct(HttpClientInterface $client = null, ResponseFactoryInterface $responseFactory = null, StreamFactoryInterface $streamFactory = null)
73+
public function __construct(?HttpClientInterface $client = null, ?ResponseFactoryInterface $responseFactory = null, ?StreamFactoryInterface $streamFactory = null)
7474
{
7575
$this->client = $client ?? HttpClient::create();
7676
$streamFactory ??= $responseFactory instanceof StreamFactoryInterface ? $responseFactory : null;
@@ -144,7 +144,7 @@ public function sendAsyncRequest(RequestInterface $request): HttplugPromise
144144
*
145145
* @return int The number of remaining pending promises
146146
*/
147-
public function wait(float $maxDuration = null, float $idleTimeout = null): int
147+
public function wait(?float $maxDuration = null, ?float $idleTimeout = null): int
148148
{
149149
return $this->waitLoop->wait(null, $maxDuration, $idleTimeout);
150150
}
@@ -268,7 +268,7 @@ public function reset(): void
268268
}
269269
}
270270

271-
private function sendPsr7Request(RequestInterface $request, bool $buffer = null): ResponseInterface
271+
private function sendPsr7Request(RequestInterface $request, ?bool $buffer = null): ResponseInterface
272272
{
273273
try {
274274
$body = $request->getBody();

Internal/AmpClientState.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private function getClient(array $options): array
149149
public $uri;
150150
public $handle;
151151

152-
public function connect(string $uri, ConnectContext $context = null, CancellationToken $token = null): Promise
152+
public function connect(string $uri, ?ConnectContext $context = null, ?CancellationToken $token = null): Promise
153153
{
154154
$result = $this->connector->connect($this->uri ?? $uri, $context, $token);
155155
$result->onResolve(function ($e, $socket) {

Internal/AmpResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct(array &$dnsMap)
3232
$this->dnsMap = &$dnsMap;
3333
}
3434

35-
public function resolve(string $name, int $typeRestriction = null): Promise
35+
public function resolve(string $name, ?int $typeRestriction = null): Promise
3636
{
3737
if (!isset($this->dnsMap[$name]) || !\in_array($typeRestriction, [Record::A, null], true)) {
3838
return Dns\resolver()->resolve($name, $typeRestriction);

Internal/HttplugWaitLoop.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(HttpClientInterface $client, ?\SplObjectStorage $pro
4646
$this->streamFactory = $streamFactory;
4747
}
4848

49-
public function wait(?ResponseInterface $pendingResponse, float $maxDuration = null, float $idleTimeout = null): int
49+
public function wait(?ResponseInterface $pendingResponse, ?float $maxDuration = null, ?float $idleTimeout = null): int
5050
{
5151
if (!$this->promisePool) {
5252
return 0;

MockHttpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class MockHttpClient implements HttpClientInterface, ResetInterface
3535
/**
3636
* @param callable|callable[]|ResponseInterface|ResponseInterface[]|iterable|null $responseFactory
3737
*/
38-
public function __construct(callable|iterable|ResponseInterface $responseFactory = null, ?string $baseUri = 'https://example.com')
38+
public function __construct(callable|iterable|ResponseInterface|null $responseFactory = null, ?string $baseUri = 'https://example.com')
3939
{
4040
$this->setResponseFactory($responseFactory);
4141
$this->defaultOptions['base_uri'] = $baseUri;
@@ -84,7 +84,7 @@ public function request(string $method, string $url, array $options = []): Respo
8484
return MockResponse::fromRequest($method, $url, $options, $response);
8585
}
8686

87-
public function stream(ResponseInterface|iterable $responses, float $timeout = null): ResponseStreamInterface
87+
public function stream(ResponseInterface|iterable $responses, ?float $timeout = null): ResponseStreamInterface
8888
{
8989
if ($responses instanceof ResponseInterface) {
9090
$responses = [$responses];

NativeHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public function request(string $method, string $url, array $options = []): Respo
264264
return new NativeResponse($this->multi, $context, implode('', $url), $options, $info, $resolver, $onProgress, $this->logger);
265265
}
266266

267-
public function stream(ResponseInterface|iterable $responses, float $timeout = null): ResponseStreamInterface
267+
public function stream(ResponseInterface|iterable $responses, ?float $timeout = null): ResponseStreamInterface
268268
{
269269
if ($responses instanceof NativeResponse) {
270270
$responses = [$responses];

NoPrivateNetworkHttpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class NoPrivateNetworkHttpClient implements HttpClientInterface, LoggerAwa
3737
* @param string|array|null $subnets String or array of subnets using CIDR notation that will be used by IpUtils.
3838
* If null is passed, the standard private subnets will be used.
3939
*/
40-
public function __construct(HttpClientInterface $client, string|array $subnets = null)
40+
public function __construct(HttpClientInterface $client, string|array|null $subnets = null)
4141
{
4242
if (!class_exists(IpUtils::class)) {
4343
throw new \LogicException(sprintf('You cannot use "%s" if the HttpFoundation component is not installed. Try running "composer require symfony/http-foundation".', __CLASS__));
@@ -72,7 +72,7 @@ public function request(string $method, string $url, array $options = []): Respo
7272
return $this->client->request($method, $url, $options);
7373
}
7474

75-
public function stream(ResponseInterface|iterable $responses, float $timeout = null): ResponseStreamInterface
75+
public function stream(ResponseInterface|iterable $responses, ?float $timeout = null): ResponseStreamInterface
7676
{
7777
return $this->client->stream($responses, $timeout);
7878
}

Psr18Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ final class Psr18Client implements ClientInterface, RequestFactoryInterface, Str
5757
private ResponseFactoryInterface $responseFactory;
5858
private StreamFactoryInterface $streamFactory;
5959

60-
public function __construct(HttpClientInterface $client = null, ResponseFactoryInterface $responseFactory = null, StreamFactoryInterface $streamFactory = null)
60+
public function __construct(?HttpClientInterface $client = null, ?ResponseFactoryInterface $responseFactory = null, ?StreamFactoryInterface $streamFactory = null)
6161
{
6262
$this->client = $client ?? HttpClient::create();
6363
$streamFactory ??= $responseFactory instanceof StreamFactoryInterface ? $responseFactory : null;

Response/AmpResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function __construct(AmpClientState $multi, Request $request, array $opti
134134
});
135135
}
136136

137-
public function getInfo(string $type = null): mixed
137+
public function getInfo(?string $type = null): mixed
138138
{
139139
return null !== $type ? $this->info[$type] ?? null : $this->info;
140140
}
@@ -179,7 +179,7 @@ private static function schedule(self $response, array &$runningResponses): void
179179
/**
180180
* @param AmpClientState $multi
181181
*/
182-
private static function perform(ClientState $multi, array &$responses = null): void
182+
private static function perform(ClientState $multi, ?array &$responses = null): void
183183
{
184184
if ($responses) {
185185
foreach ($responses as $response) {

Response/AsyncContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function cancel(): ChunkInterface
114114
/**
115115
* Returns the current info of the response.
116116
*/
117-
public function getInfo(string $type = null): mixed
117+
public function getInfo(?string $type = null): mixed
118118
{
119119
if (null !== $type) {
120120
return $this->info[$type] ?? $this->response->getInfo($type);
@@ -187,7 +187,7 @@ public function replaceResponse(ResponseInterface $response): ResponseInterface
187187
*
188188
* @param ?callable(ChunkInterface, self): ?\Iterator $passthru
189189
*/
190-
public function passthru(callable $passthru = null): void
190+
public function passthru(?callable $passthru = null): void
191191
{
192192
$this->passthru = $passthru ?? static function ($chunk, $context) {
193193
$context->passthru = null;

Response/AsyncResponse.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class AsyncResponse implements ResponseInterface, StreamableInterface
4444
/**
4545
* @param ?callable(ChunkInterface, AsyncContext): ?\Iterator $passthru
4646
*/
47-
public function __construct(HttpClientInterface $client, string $method, string $url, array $options, callable $passthru = null)
47+
public function __construct(HttpClientInterface $client, string $method, string $url, array $options, ?callable $passthru = null)
4848
{
4949
$this->client = $client;
5050
$this->shouldBuffer = $options['buffer'] ?? true;
@@ -57,7 +57,7 @@ public function __construct(HttpClientInterface $client, string $method, string
5757
}
5858
$this->response = $client->request($method, $url, ['buffer' => false] + $options);
5959
$this->passthru = $passthru;
60-
$this->initializer = static function (self $response, float $timeout = null) {
60+
$this->initializer = static function (self $response, ?float $timeout = null) {
6161
if (null === $response->shouldBuffer) {
6262
return false;
6363
}
@@ -114,7 +114,7 @@ public function getHeaders(bool $throw = true): array
114114
return $headers;
115115
}
116116

117-
public function getInfo(string $type = null): mixed
117+
public function getInfo(?string $type = null): mixed
118118
{
119119
if (null !== $type) {
120120
return $this->info[$type] ?? $this->response->getInfo($type);
@@ -206,7 +206,7 @@ public function __destruct()
206206
/**
207207
* @internal
208208
*/
209-
public static function stream(iterable $responses, float $timeout = null, string $class = null): \Generator
209+
public static function stream(iterable $responses, ?float $timeout = null, ?string $class = null): \Generator
210210
{
211211
while ($responses) {
212212
$wrappedResponses = [];
@@ -314,7 +314,7 @@ public static function stream(iterable $responses, float $timeout = null, string
314314
/**
315315
* @param \SplObjectStorage<ResponseInterface, AsyncResponse>|null $asyncMap
316316
*/
317-
private static function passthru(HttpClientInterface $client, self $r, ChunkInterface $chunk, \SplObjectStorage $asyncMap = null): \Generator
317+
private static function passthru(HttpClientInterface $client, self $r, ChunkInterface $chunk, ?\SplObjectStorage $asyncMap = null): \Generator
318318
{
319319
$r->stream = null;
320320
$response = $r->response;

Response/CurlResponse.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ final class CurlResponse implements ResponseInterface, StreamableInterface
4242
/**
4343
* @internal
4444
*/
45-
public function __construct(CurlClientState $multi, \CurlHandle|string $ch, array $options = null, LoggerInterface $logger = null, string $method = 'GET', callable $resolveRedirect = null, int $curlVersion = null, string $originalUrl = null)
45+
public function __construct(CurlClientState $multi, \CurlHandle|string $ch, ?array $options = null, ?LoggerInterface $logger = null, string $method = 'GET', ?callable $resolveRedirect = null, ?int $curlVersion = null, ?string $originalUrl = null)
4646
{
4747
$this->multi = $multi;
4848

@@ -193,7 +193,7 @@ public function __construct(CurlClientState $multi, \CurlHandle|string $ch, arra
193193
});
194194
}
195195

196-
public function getInfo(string $type = null): mixed
196+
public function getInfo(?string $type = null): mixed
197197
{
198198
if (!$info = $this->finalInfo) {
199199
$info = array_merge($this->info, curl_getinfo($this->handle));
@@ -266,7 +266,7 @@ private static function schedule(self $response, array &$runningResponses): void
266266
/**
267267
* @param CurlClientState $multi
268268
*/
269-
private static function perform(ClientState $multi, array &$responses = null): void
269+
private static function perform(ClientState $multi, ?array &$responses = null): void
270270
{
271271
if ($multi->performing) {
272272
if ($responses) {

Response/HttplugPromise.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(GuzzlePromiseInterface $promise)
3030
$this->promise = $promise;
3131
}
3232

33-
public function then(callable $onFulfilled = null, callable $onRejected = null): self
33+
public function then(?callable $onFulfilled = null, ?callable $onRejected = null): self
3434
{
3535
return new self($this->promise->then(
3636
$this->wrapThenCallback($onFulfilled),

Response/MockResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function getRequestMethod(): string
8888
return $this->requestMethod;
8989
}
9090

91-
public function getInfo(string $type = null): mixed
91+
public function getInfo(?string $type = null): mixed
9292
{
9393
return null !== $type ? $this->info[$type] ?? null : $this->info;
9494
}

Response/NativeResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function __construct(NativeClientState $multi, $context, string $url, arr
8686
});
8787
}
8888

89-
public function getInfo(string $type = null): mixed
89+
public function getInfo(?string $type = null): mixed
9090
{
9191
if (!$info = $this->finalInfo) {
9292
$info = $this->info;
@@ -228,7 +228,7 @@ private static function schedule(self $response, array &$runningResponses): void
228228
/**
229229
* @param NativeClientState $multi
230230
*/
231-
private static function perform(ClientState $multi, array &$responses = null): void
231+
private static function perform(ClientState $multi, ?array &$responses = null): void
232232
{
233233
foreach ($multi->openHandles as $i => [$pauseExpiry, $h, $buffer, $onProgress]) {
234234
if ($pauseExpiry) {

Response/StreamWrapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class StreamWrapper
4545
*
4646
* @return resource
4747
*/
48-
public static function createResource(ResponseInterface $response, HttpClientInterface $client = null)
48+
public static function createResource(ResponseInterface $response, ?HttpClientInterface $client = null)
4949
{
5050
if ($response instanceof StreamableInterface) {
5151
$stack = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS, 2);

Response/TraceableResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class TraceableResponse implements ResponseInterface, StreamableInterface
3636
private mixed $content;
3737
private ?StopwatchEvent $event;
3838

39-
public function __construct(HttpClientInterface $client, ResponseInterface $response, &$content, StopwatchEvent $event = null)
39+
public function __construct(HttpClientInterface $client, ResponseInterface $response, &$content, ?StopwatchEvent $event = null)
4040
{
4141
$this->client = $client;
4242
$this->response = $response;
@@ -134,7 +134,7 @@ public function cancel(): void
134134
}
135135
}
136136

137-
public function getInfo(string $type = null): mixed
137+
public function getInfo(?string $type = null): mixed
138138
{
139139
return $this->response->getInfo($type);
140140
}

Response/TransportResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private function doDestruct(): void
139139
*
140140
* @internal
141141
*/
142-
public static function stream(iterable $responses, float $timeout = null): \Generator
142+
public static function stream(iterable $responses, ?float $timeout = null): \Generator
143143
{
144144
$runningResponses = [];
145145

0 commit comments

Comments
 (0)