Skip to content

Commit

Permalink
Deprecate implicitly nullable parameter types
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnlk committed Dec 7, 2024
1 parent 2d9d4fd commit 853ec91
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ public static function doSleep(array $request)
*/
public static function proxy(
FutureArrayInterface $future,
callable $onFulfilled = null,
callable $onRejected = null,
callable $onProgress = null
?callable $onFulfilled = null,
?callable $onRejected = null,
?callable $onProgress = null
) {
return new FutureArray(
$future->then($onFulfilled, $onRejected, $onProgress),
Expand Down
10 changes: 5 additions & 5 deletions src/Future/BaseFutureTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ trait BaseFutureTrait
*/
public function __construct(
PromiseInterface $promise,
callable $wait = null,
callable $cancel = null
?callable $wait = null,
?callable $cancel = null
) {
$this->wrappedPromise = $promise;
$this->waitfn = $wait;
Expand Down Expand Up @@ -81,9 +81,9 @@ public function promise()
* @return PromiseInterface
*/
public function then(
callable $onFulfilled = null,
callable $onRejected = null,
callable $onProgress = null
?callable $onFulfilled = null,
?callable $onRejected = null,
?callable $onProgress = null
) {
return $this->wrappedPromise->then($onFulfilled, $onRejected, $onProgress);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Future/CompletedFutureValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CompletedFutureValue implements FutureInterface
* @param \Exception $e Error. Pass a GuzzleHttp\Ring\Exception\CancelledFutureAccessException
* to mark the future as cancelled.
*/
public function __construct($result, \Exception $e = null)
public function __construct($result, ?\Exception $e = null)
{
$this->result = $result;
$this->error = $e;
Expand Down Expand Up @@ -58,9 +58,9 @@ public function promise()
* @return PromiseInterface
*/
public function then(
callable $onFulfilled = null,
callable $onRejected = null,
callable $onProgress = null
?callable $onFulfilled = null,
?callable $onRejected = null,
?callable $onProgress = null
) {
return $this->promise()->then($onFulfilled, $onRejected, $onProgress);
}
Expand Down

0 comments on commit 853ec91

Please sign in to comment.