mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
PHPStorm can order methods by alphabet, who knew.
This commit is contained in:
@@ -121,12 +121,12 @@ class NetWorth implements NetWorthInterface
|
||||
$netWorth[$currencyCode] ??= [
|
||||
'balance' => '0',
|
||||
'native_balance' => '0',
|
||||
'currency_id' => (string) $currency->id,
|
||||
'currency_id' => (string)$currency->id,
|
||||
'currency_code' => $currency->code,
|
||||
'currency_name' => $currency->name,
|
||||
'currency_symbol' => $currency->symbol,
|
||||
'currency_decimal_places' => $currency->decimal_places,
|
||||
'native_currency_id' => (string) $default->id,
|
||||
'native_currency_id' => (string)$default->id,
|
||||
'native_currency_code' => $default->code,
|
||||
'native_currency_name' => $default->name,
|
||||
'native_currency_symbol' => $default->symbol,
|
||||
@@ -144,6 +144,15 @@ class NetWorth implements NetWorthInterface
|
||||
return $netWorth;
|
||||
}
|
||||
|
||||
private function getRepository(): AccountRepositoryInterface|AdminAccountRepositoryInterface
|
||||
{
|
||||
if (null === $this->userGroup) {
|
||||
return $this->accountRepository;
|
||||
}
|
||||
|
||||
return $this->adminAccountRepository;
|
||||
}
|
||||
|
||||
public function setUser(null|Authenticatable|User $user): void
|
||||
{
|
||||
if (!$user instanceof User) {
|
||||
@@ -189,7 +198,7 @@ class NetWorth implements NetWorthInterface
|
||||
}
|
||||
|
||||
$return[$currency->id] ??= [
|
||||
'id' => (string) $currency->id,
|
||||
'id' => (string)$currency->id,
|
||||
'name' => $currency->name,
|
||||
'symbol' => $currency->symbol,
|
||||
'code' => $currency->code,
|
||||
@@ -202,15 +211,6 @@ class NetWorth implements NetWorthInterface
|
||||
return $return;
|
||||
}
|
||||
|
||||
private function getRepository(): AccountRepositoryInterface|AdminAccountRepositoryInterface
|
||||
{
|
||||
if (null === $this->userGroup) {
|
||||
return $this->accountRepository;
|
||||
}
|
||||
|
||||
return $this->adminAccountRepository;
|
||||
}
|
||||
|
||||
private function getAccounts(): Collection
|
||||
{
|
||||
$accounts = $this->getRepository()->getAccountsByType(
|
||||
@@ -220,7 +220,7 @@ class NetWorth implements NetWorthInterface
|
||||
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
if (1 === (int) $this->getRepository()->getMetaValue($account, 'include_net_worth')) {
|
||||
if (1 === (int)$this->getRepository()->getMetaValue($account, 'include_net_worth')) {
|
||||
$filtered->push($account);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user