Code cleanup.

This commit is contained in:
James Cole
2018-04-02 14:42:07 +02:00
parent f96f38b172
commit 7d02d0f762
55 changed files with 200 additions and 281 deletions

View File

@@ -90,7 +90,7 @@ class TransactionFactory
$source = $this->create(
[
'description' => $description,
'amount' => app('steam')->negative(strval($data['amount'])),
'amount' => app('steam')->negative((string)$data['amount']),
'foreign_amount' => null,
'currency' => $currency,
'account' => $sourceAccount,
@@ -103,7 +103,7 @@ class TransactionFactory
$dest = $this->create(
[
'description' => $description,
'amount' => app('steam')->positive(strval($data['amount'])),
'amount' => app('steam')->positive((string)$data['amount']),
'foreign_amount' => null,
'currency' => $currency,
'account' => $destinationAccount,
@@ -119,9 +119,9 @@ class TransactionFactory
$this->setForeignCurrency($dest, $foreign);
// set foreign amount:
if (!is_null($data['foreign_amount'])) {
$this->setForeignAmount($source, app('steam')->negative(strval($data['foreign_amount'])));
$this->setForeignAmount($dest, app('steam')->positive(strval($data['foreign_amount'])));
if (null !== $data['foreign_amount']) {
$this->setForeignAmount($source, app('steam')->negative((string)$data['foreign_amount']));
$this->setForeignAmount($dest, app('steam')->positive((string)$data['foreign_amount']));
}
// set budget: