Better order for method arguments.

This commit is contained in:
James Cole
2025-10-08 08:54:26 +02:00
parent 8b0ee7e20a
commit 62e33a51bd
5 changed files with 10 additions and 7 deletions

View File

@@ -96,7 +96,7 @@ class IndexController extends Controller
[
$startBalances,
$endBalances,
] = Steam::accountsBalancesInRange($start, $end, $accounts, $this->primaryCurrency, $this->convertToPrimary);
] = Steam::accountsBalancesInRange($accounts, $start, $end, $this->primaryCurrency, $this->convertToPrimary);
$activities = Steam::getLastActivities($ids);
@@ -172,7 +172,7 @@ class IndexController extends Controller
[
$startBalances,
$endBalances,
] = Steam::accountsBalancesInRange($start, $end, $accounts, $this->primaryCurrency, $this->convertToPrimary);
] = Steam::accountsBalancesInRange($accounts, $start, $end, $this->primaryCurrency, $this->convertToPrimary);
$activities = Steam::getLastActivities($ids);

View File

@@ -120,7 +120,7 @@ class AccountController extends Controller
[
$startBalances,
$endBalances,
] = Steam::accountsBalancesInRange($start, $end, $accounts, $this->primaryCurrency, $this->convertToPrimary);
] = Steam::accountsBalancesInRange($accounts, $start, $end, $this->primaryCurrency, $this->convertToPrimary);
Log::debug('Done collecting balances');
// loop the accounts, then check for balance and currency info.
foreach ($accounts as $account) {
@@ -671,7 +671,7 @@ class AccountController extends Controller
[
$startBalances,
$endBalances,
] = Steam::accountsBalancesInRange($start, $end, $accounts, $this->primaryCurrency, $this->convertToPrimary);
] = Steam::accountsBalancesInRange($accounts, $start, $end , $this->primaryCurrency, $this->convertToPrimary);
// loop the accounts, then check for balance and currency info.

View File

@@ -54,7 +54,7 @@ class AccountTasker implements AccountTaskerInterface, UserGroupInterface
[
$startSet,
$endSet,
] = Steam::accountsBalancesInRange($yesterday, $end, $accounts);
] = Steam::accountsBalancesInRange($accounts, $yesterday, $end);
Log::debug('Start of accountreport');
/** @var AccountRepositoryInterface $repository */

View File

@@ -292,7 +292,7 @@ class AccountEnrichment implements EnrichmentInterface
[
$this->startBalances,
$this->endBalances,
] = Steam::accountsBalancesInRange($this->start, $this->end, $this->collection, $this->primaryCurrency, $this->convertToPrimary);
] = Steam::accountsBalancesInRange($this->collection, $this->start, $this->end, $this->primaryCurrency, $this->convertToPrimary);
}
}

View File

@@ -127,7 +127,7 @@ class Steam
/**
* Calls accountsBalancesOptimized for the given accounts and makes sure that inclusive is set to false, so it properly gets the balance of a range.
*/
public function accountsBalancesInRange(Carbon $start, Carbon $end, Collection $accounts, ?TransactionCurrency $primary = null, ?bool $convertToPrimary = null): array
public function accountsBalancesInRange(Collection $accounts, Carbon $start, Carbon $end, ?TransactionCurrency $primary = null, ?bool $convertToPrimary = null): array
{
return [
$this->accountsBalancesOptimized($accounts, $start, $primary, $convertToPrimary, inclusive: false),
@@ -373,6 +373,9 @@ class Steam
return $final;
}
/**
* @deprecated
*/
public function finalAccountBalanceInRange(Account $account, Carbon $start, Carbon $end, bool $convertToPrimary): array
{
// expand period.