mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 20:16:22 +00:00
Fix phpstan issues
This commit is contained in:
@@ -83,7 +83,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
|
||||
];
|
||||
|
||||
$array[$currencyId]['transaction_journals'][$journalId] = [
|
||||
'amount' => app('steam')->{$direction}((string) $journal['amount']), // @phpstan-ignore-line
|
||||
'amount' => Steam::{$direction}((string) $journal['amount']), // @phpstan-ignore-line
|
||||
'date' => $journal['date'],
|
||||
'transaction_journal_id' => $journalId,
|
||||
'budget_name' => $journal['budget_name'],
|
||||
@@ -331,7 +331,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
|
||||
$currencyId = $journal['currency_id'];
|
||||
$sourceKey = sprintf('%d-%d', $currencyId, $sourceId);
|
||||
$destKey = sprintf('%d-%d', $currencyId, $destinationId);
|
||||
$amount = app('steam')->positive($journal['amount']);
|
||||
$amount = Steam::positive($journal['amount']);
|
||||
|
||||
// source first
|
||||
$return[$sourceKey] ??= [
|
||||
@@ -366,7 +366,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
|
||||
$return[$sourceKey]['difference'] = bcadd($return[$sourceKey]['out'], (string) $return[$sourceKey]['in']);
|
||||
|
||||
// destination account? money comes in:
|
||||
$return[$destKey]['in'] = bcadd((string) $return[$destKey]['in'], (string) $amount);
|
||||
$return[$destKey]['in'] = bcadd((string) $return[$destKey]['in'], $amount);
|
||||
$return[$destKey]['difference'] = bcadd((string) $return[$destKey]['out'], $return[$destKey]['in']);
|
||||
|
||||
// foreign currency
|
||||
@@ -374,7 +374,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
|
||||
$currencyId = $journal['foreign_currency_id'];
|
||||
$sourceKey = sprintf('%d-%d', $currencyId, $sourceId);
|
||||
$destKey = sprintf('%d-%d', $currencyId, $destinationId);
|
||||
$amount = app('steam')->positive($journal['foreign_amount']);
|
||||
$amount = Steam::positive($journal['foreign_amount']);
|
||||
|
||||
// same as above:
|
||||
// source first
|
||||
@@ -409,7 +409,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
|
||||
$return[$sourceKey]['difference'] = bcadd($return[$sourceKey]['out'], (string) $return[$sourceKey]['in']);
|
||||
|
||||
// destination account? money comes in:
|
||||
$return[$destKey]['in'] = bcadd((string) $return[$destKey]['in'], (string) $amount);
|
||||
$return[$destKey]['in'] = bcadd((string) $return[$destKey]['in'], $amount);
|
||||
$return[$destKey]['difference'] = bcadd((string) $return[$destKey]['out'], $return[$destKey]['in']);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user