Skip to content

Commit

Permalink
Merge pull request #85 from annuh/fix-cannot-assign-null-to-HttpClien…
Browse files Browse the repository at this point in the history
…tException-response

fix: make HttpClientException::response nullable
  • Loading branch information
firstred authored Dec 10, 2023
2 parents 97cb6bc + f0a6fc0 commit e56eea9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Exception/HttpClientException.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@
*/
class HttpClientException extends PostNLException
{
private ResponseInterface $response;
private ?ResponseInterface $response;

public function __construct(string $message = '', int $code = 0, ?Exception $previous = null, ResponseInterface $response = null)
public function __construct(string $message = '', int $code = 0, ?Exception $previous = null, ?ResponseInterface $response = null)
{
parent::__construct(message: $message, code: $code, previous: $previous);

$this->response = $response;
}

public function setResponse(ResponseInterface $response)
public function setResponse(?ResponseInterface $response)
{
$this->response = $response;
}

public function getResponse(): ResponseInterface
public function getResponse(): ?ResponseInterface
{
return $this->response;
}
Expand Down

0 comments on commit e56eea9

Please sign in to comment.