Skip to content

Commit 98b4ece

Browse files
committed
Add typed properties to Exception handling
1 parent 869899f commit 98b4ece

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Exceptions/VippsException.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class VippsException extends \Exception
2424
/**
2525
* @var \zaporylie\Vipps\Model\Error\ErrorInterface|null
2626
*/
27-
protected $error;
27+
protected ?ErrorInterface $error;
2828

2929
/**
3030
* VippsException constructor.
@@ -34,7 +34,7 @@ class VippsException extends \Exception
3434
* @param \Exception|null $previous
3535
* @param \zaporylie\Vipps\Model\Error\ErrorInterface|null $error
3636
*/
37-
public function __construct($message = '', $code = 0, \Exception $previous = null, ErrorInterface $error = null)
37+
public function __construct($message = '', $code = 0, \Exception $previous = null, ?ErrorInterface $error = null)
3838
{
3939
parent::__construct($message, $code, $previous);
4040
$this->error = $error;
@@ -99,7 +99,7 @@ public static function createFromResponse(
9999
ResponseInterface $response,
100100
$serializer = null,
101101
$force = true
102-
) {
102+
): ?VippsException {
103103

104104
// If error code tells us that something went wrong we must accept it.
105105
if (!$force && $response->getStatusCode() >= 400) {

0 commit comments

Comments
 (0)