mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-25 13:10:35 +00:00
Refactor phpstan errors.
This commit is contained in:
@@ -255,7 +255,7 @@ trait AccountServiceTrait
|
||||
// get or grab currency:
|
||||
$currency = $this->accountRepository->getAccountCurrency($account);
|
||||
if (null === $currency) {
|
||||
$currency = app('default')->getDefaultCurrencyByUser($account->user);
|
||||
$currency = app('amount')->getDefaultCurrencyByUserGroup($account->user->userGroup);
|
||||
}
|
||||
|
||||
// submit to factory:
|
||||
@@ -386,7 +386,7 @@ trait AccountServiceTrait
|
||||
|
||||
if (null === $currency) {
|
||||
// use default currency:
|
||||
$currency = app('amount')->getDefaultCurrencyByUser($this->user);
|
||||
$currency = app('amount')->getDefaultCurrencyByUserGroup($this->user->userGroup);
|
||||
}
|
||||
$currency->enabled = true;
|
||||
$currency->save();
|
||||
@@ -433,7 +433,7 @@ trait AccountServiceTrait
|
||||
// if exists, update:
|
||||
$currency = $this->accountRepository->getAccountCurrency($account);
|
||||
if (null === $currency) {
|
||||
$currency = app('default')->getDefaultCurrencyByUser($account->user);
|
||||
$currency = app('amount')->getDefaultCurrencyByUserGroup($account->user);
|
||||
}
|
||||
|
||||
// simply grab the first journal and change it:
|
||||
@@ -500,7 +500,7 @@ trait AccountServiceTrait
|
||||
// get or grab currency:
|
||||
$currency = $this->accountRepository->getAccountCurrency($account);
|
||||
if (null === $currency) {
|
||||
$currency = app('default')->getDefaultCurrencyByUser($account->user);
|
||||
$currency = app('amount')->getDefaultCurrencyByUserGroup($account->user->userGroup);
|
||||
}
|
||||
|
||||
// submit to factory:
|
||||
@@ -632,7 +632,7 @@ trait AccountServiceTrait
|
||||
// if exists, update:
|
||||
$currency = $this->accountRepository->getAccountCurrency($account);
|
||||
if (null === $currency) {
|
||||
$currency = app('default')->getDefaultCurrencyByUser($account->user);
|
||||
$currency = app('amount')->getDefaultCurrencyByUserGroup($account->user->userGroup);
|
||||
}
|
||||
|
||||
// simply grab the first journal and change it:
|
||||
@@ -715,7 +715,7 @@ trait AccountServiceTrait
|
||||
// get or grab currency:
|
||||
$currency = $this->accountRepository->getAccountCurrency($account);
|
||||
if (null === $currency) {
|
||||
$currency = app('default')->getDefaultCurrencyByUser($account->user);
|
||||
$currency = app('amount')->getDefaultCurrencyByUserGroup($account->user->userGroup);
|
||||
}
|
||||
|
||||
// submit to factory:
|
||||
|
||||
@@ -119,7 +119,7 @@ trait RecurringTransactionTrait
|
||||
$currency = $factory->find($array['currency_id'] ?? null, $array['currency_code'] ?? null);
|
||||
$foreignCurrency = $factory->find($array['foreign_currency_id'] ?? null, $array['foreign_currency_code'] ?? null);
|
||||
if (null === $currency) {
|
||||
$currency = app('amount')->getDefaultCurrencyByUser($recurrence->user);
|
||||
$currency = app('amount')->getDefaultCurrencyByUserGroup($recurrence->user->userGroup);
|
||||
}
|
||||
|
||||
app('log')->debug(
|
||||
|
||||
@@ -60,7 +60,7 @@ class BillUpdateService
|
||||
if (array_key_exists('currency_id', $data) || array_key_exists('currency_code', $data)) {
|
||||
$factory = app(TransactionCurrencyFactory::class);
|
||||
$currency = $factory->find((int)($data['currency_id'] ?? null), $data['currency_code'] ?? null) ??
|
||||
app('amount')->getDefaultCurrencyByUser($bill->user);
|
||||
app('amount')->getDefaultCurrencyByUserGroup($bill->user->userGroup);
|
||||
|
||||
// enable the currency if it isn't.
|
||||
$currency->enabled = true;
|
||||
|
||||
Reference in New Issue
Block a user