Skip to content

Commit

Permalink
fix: php7.4 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Naoray committed Jan 21, 2025
1 parent 46722e2 commit 8d64e2a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Traits/HasResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Mollie\Api\Http\PendingRequest;
use Mollie\Api\Http\Response;
use Mollie\Api\Exceptions\MollieException;

trait HasResponse
{
Expand All @@ -23,8 +24,10 @@ public function setResponse(?Response $response): self

public function getPendingRequest(): PendingRequest
{
return $this->response
? $this->response->getPendingRequest()
: throw new \Exception('Response is not set');
if (! $this->response) {
throw new MollieException('Response is not set');
}

return $this->response->getPendingRequest();
}
}

0 comments on commit 8d64e2a

Please sign in to comment.