Skip to content

Commit

Permalink
Merge pull request #3 from paytic/master
Browse files Browse the repository at this point in the history
refactor: add nullable types for delivery in order
  • Loading branch information
stevro authored Apr 15, 2024
2 parents 9d180a5 + 64ab305 commit c8d8fc3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
11 changes: 5 additions & 6 deletions src/Model/CustomerDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ class CustomerDetails
private ?string $contact;

/**
* @var DeliveryInfo
* @Serializer\Type("Stev\BTIPay\Model\DeliveryInfo")
*/
private DeliveryInfo $deliveryInfo;
private ?DeliveryInfo $deliveryInfo = null;

/**
* @var BillingInfo
Expand Down Expand Up @@ -102,18 +101,18 @@ public function setContact($contact): static
}

/**
* @return DeliveryInfo
* @return DeliveryInfo|null
*/
public function getDeliveryInfo(): DeliveryInfo
public function getDeliveryInfo(): ?DeliveryInfo
{
return $this->deliveryInfo;
}

/**
* @param DeliveryInfo $deliveryInfo
* @param DeliveryInfo|null $deliveryInfo
* @return CustomerDetails
*/
public function setDeliveryInfo(DeliveryInfo $deliveryInfo): static
public function setDeliveryInfo(?DeliveryInfo $deliveryInfo): static
{
$this->deliveryInfo = $deliveryInfo;

Expand Down
11 changes: 5 additions & 6 deletions src/Responses/BaseResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ class BaseResponse implements ResponseInterface


/**
* @var int
* @Serializer\Type("int")
*/
protected int $errorCode;
protected ?int $errorCode = null;

/**
* @var string
Expand All @@ -24,18 +23,18 @@ class BaseResponse implements ResponseInterface
protected string $errorMessage;

/**
* @return int
* @return int|null
*/
public function getErrorCode(): int
public function getErrorCode(): ?int
{
return $this->errorCode;
}

/**
* @param int $errorCode
* @param int|null $errorCode
* @return BaseResponse
*/
public function setErrorCode($errorCode): static
public function setErrorCode(?int $errorCode): static
{
$this->errorCode = $errorCode;

Expand Down

0 comments on commit c8d8fc3

Please sign in to comment.