Skip to content

Commit 44219c6

Browse files
committed
Fix implicitly nullable parameters
1 parent a014b4e commit 44219c6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Client.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ class Client implements HttpClient, HttpAsyncClient
7777
* @since 2.0 Accepts PSR-17 factories instead of HTTPlug ones.
7878
*/
7979
public function __construct(
80-
ResponseFactoryInterface $responseFactory = null,
81-
StreamFactoryInterface $streamFactory = null,
80+
?ResponseFactoryInterface $responseFactory = null,
81+
?StreamFactoryInterface $streamFactory = null,
8282
array $options = []
8383
) {
8484
$this->responseFactory = $responseFactory ?: Psr17FactoryDiscovery::findResponseFactory();

src/CurlPromise.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ public function __construct(PromiseCore $core, MultiRunner $runner)
5151
* If you do not care about one of the cases, you can set the corresponding callable to null
5252
* The callback will be called when the response or exception arrived and never more than once.
5353
*
54-
* @param callable $onFulfilled Called when a response will be available
55-
* @param callable $onRejected Called when an error happens.
54+
* @param callable|null $onFulfilled Called when a response will be available
55+
* @param callable|null $onRejected Called when an error happens.
5656
*
5757
* You must always return the Response in the interface or throw an Exception
5858
*
5959
* @return Promise Always returns a new promise which is resolved with value of the executed
6060
* callback (onFulfilled / onRejected)
6161
*/
62-
public function then(callable $onFulfilled = null, callable $onRejected = null)
62+
public function then(?callable $onFulfilled = null, ?callable $onRejected = null)
6363
{
6464
if ($onFulfilled) {
6565
$this->core->addOnFulfilled($onFulfilled);

src/MultiRunner.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function remove(PromiseCore $core): void
8181
*
8282
* @param PromiseCore|null $targetCore
8383
*/
84-
public function wait(PromiseCore $targetCore = null): void
84+
public function wait(?PromiseCore $targetCore = null): void
8585
{
8686
do {
8787
$status = curl_multi_exec($this->multiHandle, $active);

0 commit comments

Comments
 (0)