Code cleanup

This commit is contained in:
James Cole
2018-04-02 14:50:17 +02:00
parent 379b104778
commit fa7ab45a40
100 changed files with 440 additions and 517 deletions

View File

@@ -41,7 +41,7 @@ class Customer extends SpectreObject
*/
public function __construct(array $data)
{
$this->id = intval($data['id']);
$this->id = (int)$data['id'];
$this->identifier = $data['identifier'];
$this->secret = $data['secret'];
}

View File

@@ -84,7 +84,7 @@ class Transaction extends SpectreObject
*/
public function getAmount(): string
{
return strval($this->amount);
return (string)$this->amount;
}
/**
@@ -124,7 +124,7 @@ class Transaction extends SpectreObject
*/
public function getHash(): string
{
$array = [
$array = [
'id' => $this->id,
'mode' => $this->mode,
'status' => $this->status,
@@ -139,9 +139,8 @@ class Transaction extends SpectreObject
'created_at' => $this->createdAt->toIso8601String(),
'updated_at' => $this->updatedAt->toIso8601String(),
];
$hashed = hash('sha256', json_encode($array));
return $hashed;
return hash('sha256', json_encode($array));
}
/**

View File

@@ -136,9 +136,9 @@ class TransactionExtra extends SpectreObject
'id' => $this->id,
'record_number' => $this->recordNumber,
'information' => $this->information,
'time' => is_null($this->time) ? null : $this->time->toIso8601String(),
'posting_date' => is_null($this->postingDate) ? null : $this->postingDate->toIso8601String(),
'posting_time' => is_null($this->postingTime) ? null : $this->postingTime->toIso8601String(),
'time' => null === $this->time ? null : $this->time->toIso8601String(),
'posting_date' => null === $this->postingDate ? null : $this->postingDate->toIso8601String(),
'posting_time' => null === $this->postingTime ? null : $this->postingTime->toIso8601String(),
'account_number' => $this->accountNumber,
'original_amount' => $this->originalAmount,
'original_currency_code' => $this->originalCurrencyCode,