Skip to content

Commit

Permalink
do not use getters for own properties
Browse files Browse the repository at this point in the history
  • Loading branch information
grummbeer committed Dec 11, 2023
1 parent afc9696 commit d2732dd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public function getAccountHolderName(): string
public function toArray(): array
{
return [
'bankCode' => $this->getBankCode()->getString(),
'accountNumber' => $this->getAccountNumber(),
'accountHolderName' => $this->getAccountHolderName(),
'bankCode' => $this->bankCode->getString(),
'accountNumber' => $this->accountNumber,
'accountHolderName' => $this->accountHolderName,
];
}
}
8 changes: 4 additions & 4 deletions src/Balance.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public function getValue(): Money
public function toArray(): array
{
return [
'type' => $this->getType(),
'type' => $this->type,
'value' => [
'amount' => $this->getValue()->getAmount(),
'amount' => $this->value->getAmount(),
'currency' => $this->value->getCurrency()->getCode(),
'priceUnit' => 100,
'currency' => $this->getValue()->getCurrency()->getCode(),
],
'date' => $this->getDate()->format('Y-m-d'),
'date' => $this->date->format('Y-m-d'),
];
}
}
20 changes: 10 additions & 10 deletions src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,19 @@ public function getType(): string
public function toArray(): array
{
return [
'date' => $this->getDate()->format('Y-m-d'),
'localAccount' => $this->getLocalAccount()->toArray(),
'purpose' => $this->getPurpose(),
'remoteAccount' => $this->getRemoteAccount()->toArray(),
'type' => $this->getType(),
'date' => $this->date->format('Y-m-d'),
'localAccount' => $this->localAccount->toArray(),
'purpose' => $this->purpose,
'remoteAccount' => $this->remoteAccount->toArray(),
'type' => $this->type,
'value' => [
'amount' => $this->getValue()->getAmount(),
'currency' => $this->getValue()->getCurrency()->getCode(),
'amount' => $this->value->getAmount(),
'currency' => $this->value->getCurrency()->getCode(),
'priceUnit' => 100,
],
'valutaDate' => $this->getValutaDate()?->format('Y-m-d'),
'primaNota' => $this->getPrimaNota(),
'customerReference' => $this->getCustomerReference(),
'valutaDate' => $this->valutaDate?->format('Y-m-d'),
'primaNota' => $this->primaNota,
'customerReference' => $this->customerReference,
];
}
}
2 changes: 1 addition & 1 deletion tests/BalanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public function testBalance(): void
'type' => 'noted',
'value' => [
'amount' => '10',
'priceUnit' => 100,
'currency' => 'EUR',
'priceUnit' => 100,
],
'date' => $date->format('Y-m-d'),
], $sut->toArray());
Expand Down

0 comments on commit d2732dd

Please sign in to comment.