Skip to content

Commit d4650c1

Browse files
committed
Fixed null depecrations
1 parent bb66440 commit d4650c1

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Client
1818
public function __construct(
1919
string $host,
2020
string $apiKey,
21-
HttpClient $httpClient = null
21+
?HttpClient $httpClient = null
2222
) {
2323
$this->httpClient = $httpClient ?: HttpClientFactory::create($host, $apiKey);
2424
$this->messages = new MessagesService($this);

src/HttpClientFactory.php

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

1010
class HttpClientFactory
1111
{
12-
public static function create(string $host, string $apiKey, callable $handler = null): Client
12+
public static function create(string $host, string $apiKey, ?callable $handler = null): Client
1313
{
1414
if ($handler === null) {
1515
$handler = HandlerStack::create();

src/RetryMiddlewareFactory.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public static function buildDecider(): callable
2525
return function (
2626
$retries,
2727
Request $request,
28-
Response $response = null,
29-
Throwable $exception = null
28+
?Response $response = null,
29+
?Throwable $exception = null
3030
) {
3131
if ($retries > self::$maxRetries) {
3232
return false;
@@ -48,18 +48,18 @@ public static function buildDelay(): callable
4848
{
4949
return function (
5050
$retries,
51-
Response $response = null
51+
?Response $response = null
5252
) {
5353
return self::$defaultRetryDelay;
5454
};
5555
}
5656

57-
private static function isConnectionError(\Throwable $exception = null): bool
57+
private static function isConnectionError(?\Throwable $exception = null): bool
5858
{
5959
return $exception instanceof \GuzzleHttp\Exception\ConnectException;
6060
}
6161

62-
private static function isInternalServerError(\Throwable $exception = null): bool
62+
private static function isInternalServerError(?\Throwable $exception = null): bool
6363
{
6464
return $exception instanceof \GuzzleHttp\Exception\ServerException;
6565
}

0 commit comments

Comments
 (0)