Skip to content

Commit 5777997

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent 8fe833b commit 5777997

31 files changed

+49
-49
lines changed

AmpHttpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ final class AmpHttpClient implements HttpClientInterface, LoggerAwareInterface,
6262
*
6363
* @see HttpClientInterface::OPTIONS_DEFAULTS for available options
6464
*/
65-
public function __construct(array $defaultOptions = [], callable $clientConfigurator = null, int $maxHostConnections = 6, int $maxPendingPushes = 50)
65+
public function __construct(array $defaultOptions = [], ?callable $clientConfigurator = null, int $maxHostConnections = 6, int $maxPendingPushes = 50)
6666
{
6767
$this->defaultOptions['buffer'] = $this->defaultOptions['buffer'] ?? \Closure::fromCallable([__CLASS__, 'shouldBuffer']);
6868

@@ -151,7 +151,7 @@ public function request(string $method, string $url, array $options = []): Respo
151151
/**
152152
* {@inheritdoc}
153153
*/
154-
public function stream($responses, float $timeout = null): ResponseStreamInterface
154+
public function stream($responses, ?float $timeout = null): ResponseStreamInterface
155155
{
156156
if ($responses instanceof AmpResponse) {
157157
$responses = [$responses];

AsyncDecoratorTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ abstract public function request(string $method, string $url, array $options = [
3535
/**
3636
* {@inheritdoc}
3737
*/
38-
public function stream($responses, float $timeout = null): ResponseStreamInterface
38+
public function stream($responses, ?float $timeout = null): ResponseStreamInterface
3939
{
4040
if ($responses instanceof AsyncResponse) {
4141
$responses = [$responses];

CachingHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function request(string $method, string $url, array $options = []): Respo
110110
/**
111111
* {@inheritdoc}
112112
*/
113-
public function stream($responses, float $timeout = null): ResponseStreamInterface
113+
public function stream($responses, ?float $timeout = null): ResponseStreamInterface
114114
{
115115
if ($responses instanceof ResponseInterface) {
116116
$responses = [$responses];

Chunk/ErrorChunk.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function getError(): ?string
111111
/**
112112
* @return bool Whether the wrapped error has been thrown or not
113113
*/
114-
public function didThrow(bool $didThrow = null): bool
114+
public function didThrow(?bool $didThrow = null): bool
115115
{
116116
if (null !== $didThrow && $this->didThrow !== $didThrow) {
117117
return !$this->didThrow = $didThrow;

CurlHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public function request(string $method, string $url, array $options = []): Respo
316316
/**
317317
* {@inheritdoc}
318318
*/
319-
public function stream($responses, float $timeout = null): ResponseStreamInterface
319+
public function stream($responses, ?float $timeout = null): ResponseStreamInterface
320320
{
321321
if ($responses instanceof CurlResponse) {
322322
$responses = [$responses];

DataCollector/HttpClientDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function registerClient(string $name, TraceableHttpClient $client)
3636
/**
3737
* {@inheritdoc}
3838
*/
39-
public function collect(Request $request, Response $response, \Throwable $exception = null)
39+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
4040
{
4141
$this->lateCollect();
4242
}

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 $client;
2727

28-
public function __construct(HttpClientInterface $client = null)
28+
public function __construct(?HttpClientInterface $client = null)
2929
{
3030
$this->client = $client ?? HttpClient::create();
3131
}
@@ -41,7 +41,7 @@ public function request(string $method, string $url, array $options = []): Respo
4141
/**
4242
* {@inheritdoc}
4343
*/
44-
public function stream($responses, float $timeout = null): ResponseStreamInterface
44+
public function stream($responses, ?float $timeout = null): ResponseStreamInterface
4545
{
4646
return $this->client->stream($responses, $timeout);
4747
}

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 $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
@@ -419,7 +419,7 @@ private static function normalizePeerFingerprint($fingerprint): array
419419
*
420420
* @throws InvalidArgumentException When the value cannot be json-encoded
421421
*/
422-
private static function jsonEncode($value, int $flags = null, int $maxDepth = 512): string
422+
private static function jsonEncode($value, ?int $flags = null, int $maxDepth = 512): string
423423
{
424424
$flags = $flags ?? (\JSON_HEX_TAG | \JSON_HEX_APOS | \JSON_HEX_AMP | \JSON_HEX_QUOT | \JSON_PRESERVE_ZERO_FRACTION);
425425

HttplugClient.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ final class HttplugClient implements HttplugInterface, HttpAsyncClient, RequestF
7171

7272
private $waitLoop;
7373

74-
public function __construct(HttpClientInterface $client = null, ResponseFactoryInterface $responseFactory = null, StreamFactoryInterface $streamFactory = null)
74+
public function __construct(?HttpClientInterface $client = null, ?ResponseFactoryInterface $responseFactory = null, ?StreamFactoryInterface $streamFactory = null)
7575
{
7676
$this->client = $client ?? HttpClient::create();
7777
$this->responseFactory = $responseFactory;
@@ -145,7 +145,7 @@ public function sendAsyncRequest(RequestInterface $request): Promise
145145
*
146146
* @return int The number of remaining pending promises
147147
*/
148-
public function wait(float $maxDuration = null, float $idleTimeout = null): int
148+
public function wait(?float $maxDuration = null, ?float $idleTimeout = null): int
149149
{
150150
return $this->waitLoop->wait(null, $maxDuration, $idleTimeout);
151151
}
@@ -247,7 +247,7 @@ public function reset()
247247
}
248248
}
249249

250-
private function sendPsr7Request(RequestInterface $request, bool $buffer = null): ResponseInterface
250+
private function sendPsr7Request(RequestInterface $request, ?bool $buffer = null): ResponseInterface
251251
{
252252
try {
253253
$body = $request->getBody();

0 commit comments

Comments
 (0)