Fix phpstan issues

This commit is contained in:
James Cole
2025-09-07 07:31:00 +02:00
parent b87b99a755
commit 296a64e284
103 changed files with 605 additions and 617 deletions

View File

@@ -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']);
}