Skip to content

Commit 8afe5aa

Browse files
committed
PHP 8.4 fix implicitly nullable via default value null
1 parent 3e49b43 commit 8afe5aa

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/Api/AbstractApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ abstract class AbstractApi
1919
/** @var ResponseMediator */
2020
private $responseMediator;
2121

22-
public function __construct(Client $client, ResponseMediator $responseMediator = null)
22+
public function __construct(Client $client, ?ResponseMediator $responseMediator = null)
2323
{
2424
$this->client = $client;
25-
$this->responseMediator = $responseMediator ? $responseMediator : new ResponseMediator();
25+
$this->responseMediator = $responseMediator ? : new ResponseMediator();
2626
}
2727

2828
/**

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Client
2525
private $responseMediator;
2626

2727
/** @param string $privatePackagistUrl */
28-
public function __construct(HttpPluginClientBuilder $httpClientBuilder = null, $privatePackagistUrl = null, ResponseMediator $responseMediator = null)
28+
public function __construct(?HttpPluginClientBuilder $httpClientBuilder = null, $privatePackagistUrl = null, ?ResponseMediator $responseMediator = null)
2929
{
3030
$this->httpClientBuilder = $builder = $httpClientBuilder ?: new HttpPluginClientBuilder();
3131
$privatePackagistUrl = $privatePackagistUrl ? : 'https://packagist.com';

src/Exception/HttpTransportException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class HttpTransportException extends RuntimeException
1515
{
1616
private $requestUri;
1717

18-
public function __construct($message = "", $code = 0, $requestUri = "", Throwable $previous = null)
18+
public function __construct($message = "", $code = 0, $requestUri = "", ?Throwable $previous = null)
1919
{
2020
$this->requestUri = $requestUri;
2121
parent::__construct($message, $code, $previous);

src/HttpClient/Plugin/ExceptionThrower.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ class ExceptionThrower implements Plugin
2424
/** @var ResponseMediator */
2525
private $responseMediator;
2626

27-
public function __construct(ResponseMediator $responseMediator = null)
27+
public function __construct(?ResponseMediator $responseMediator = null)
2828
{
29-
$this->responseMediator = $responseMediator ? $responseMediator : new ResponseMediator();
29+
$this->responseMediator = $responseMediator ? : new ResponseMediator();
3030
}
3131

3232
protected function doHandleRequest(RequestInterface $request, callable $next, callable $first)

0 commit comments

Comments
 (0)