8000 Merge branch '5.4' into 6.3 · symfony/http-client@5b7fa7e · GitHub
[go: up one dir, main page]

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 = []): Re EF5E spo
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();

0 commit comments

Comments
 (0)
0