Skip to content

Commit

Permalink
balance proprietà nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Bertoldi committed May 16, 2024
1 parent b18a53e commit 7a4d7ac
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Models/Balance.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

class Balance extends GenericModel {
/**
* @var string
* @var string|null
*/
private $Currency;

/**
* @var float
* @var float|null
*/
private $AvailableBalance;

Expand All @@ -21,7 +21,7 @@ class Balance extends GenericModel {
private $AccountingBalance;

/**
* @var float
* @var float|null
*/
private $CreditLine;

Expand All @@ -34,10 +34,10 @@ class Balance extends GenericModel {
protected function hydrateData( stdClass $data ) {
$payload = $data->payload;

$this->Currency = (string)$payload->currency;
$this->AvailableBalance = (float)$payload->availableBalance;
$this->Currency = is_null( $payload->currency ) ? null : (string)$payload->currency;
$this->AvailableBalance = is_null( $payload->availableBalance ) ? null : (float)$payload->availableBalance;
$this->AccountingBalance = (float)$payload->accountingBalance;
$this->CreditLine = (float)$payload->creditLine;
$this->CreditLine = is_null( $payload->creditLine ) ? null : (float)$payload->creditLine;
}


Expand Down

0 comments on commit 7a4d7ac

Please sign in to comment.