Skip to content
Snippets Groups Projects
Unverified Commit 87779285 authored by David Buchmann's avatar David Buchmann Committed by GitHub
Browse files

Merge pull request #175 from derrabus/bugfix/implicit-nullable

Make nullable parameter types explicit
parents 074c34ab a1429d6a
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ class HttpException extends RequestException
$message,
RequestInterface $request,
ResponseInterface $response,
\Exception $previous = null
?\Exception $previous = null
) {
parent::__construct($message, $request, $previous);
......@@ -50,7 +50,7 @@ class HttpException extends RequestException
public static function create(
RequestInterface $request,
ResponseInterface $response,
\Exception $previous = null
?\Exception $previous = null
) {
$message = sprintf(
'[url] %s [http method] %s [status code] %s [reason phrase] %s',
......
......@@ -19,7 +19,7 @@ class NetworkException extends TransferException implements PsrNetworkException
/**
* @param string $message
*/
public function __construct($message, RequestInterface $request, \Exception $previous = null)
public function __construct($message, RequestInterface $request, ?\Exception $previous = null)
{
$this->setRequest($request);
......
......@@ -20,7 +20,7 @@ class RequestException extends TransferException implements PsrRequestException
/**
* @param string $message
*/
public function __construct($message, RequestInterface $request, \Exception $previous = null)
public function __construct($message, RequestInterface $request, ?\Exception $previous = null)
{
$this->setRequest($request);
......
......@@ -18,7 +18,7 @@ final class HttpFulfilledPromise implements Promise
$this->response = $response;
}
public function then(callable $onFulfilled = null, callable $onRejected = null)
public function then(?callable $onFulfilled = null, ?callable $onRejected = null)
{
if (null === $onFulfilled) {
return $this;
......
......@@ -17,7 +17,7 @@ final class HttpRejectedPromise implements Promise
$this->exception = $exception;
}
public function then(callable $onFulfilled = null, callable $onRejected = null)
public function then(?callable $onFulfilled = null, ?callable $onRejected = null)
{
if (null === $onRejected) {
return $this;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment