mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-26 05:26:17 +00:00
Refactor phpstan errors.
This commit is contained in:
@@ -184,7 +184,7 @@ class AccountTransformer extends AbstractTransformer
|
||||
|
||||
// only grab default when result is null:
|
||||
if (null === $currency) {
|
||||
$currency = app('amount')->getDefaultCurrencyByUser($account->user);
|
||||
$currency = app('amount')->getDefaultCurrencyByUserGroup($account->user->userGroup);
|
||||
}
|
||||
$currencyId = (string)$currency->id;
|
||||
$currencyCode = $currency->code;
|
||||
|
||||
@@ -67,7 +67,7 @@ class PiggyBankEventTransformer extends AbstractTransformer
|
||||
$this->piggyRepos->setUser($account->user);
|
||||
|
||||
// get associated currency or fall back to the default:
|
||||
$currency = $this->repository->getAccountCurrency($account) ?? app('amount')->getDefaultCurrencyByUser($account->user);
|
||||
$currency = $this->repository->getAccountCurrency($account) ?? app('amount')->getDefaultCurrencyByUserGroup($account->user->userGroup);
|
||||
|
||||
// get associated journal and transaction, if any:
|
||||
$journalId = $event->transaction_journal_id;
|
||||
|
||||
@@ -67,7 +67,7 @@ class PiggyBankTransformer extends AbstractTransformer
|
||||
$this->piggyRepos->setUser($account->user);
|
||||
|
||||
// get currency from account, or use default.
|
||||
$currency = $this->accountRepos->getAccountCurrency($account) ?? app('amount')->getDefaultCurrencyByUser($account->user);
|
||||
$currency = $this->accountRepos->getAccountCurrency($account) ?? app('amount')->getDefaultCurrencyByUserGroup($account->user->userGroup);
|
||||
|
||||
// note
|
||||
$notes = $this->piggyRepos->getNoteText($piggyBank);
|
||||
|
||||
@@ -131,7 +131,7 @@ class PiggyBankTransformer extends AbstractTransformer
|
||||
$this->notes[$id] = $note;
|
||||
}
|
||||
|
||||
$this->default = app('amount')->getDefaultCurrencyByUser(auth()->user());
|
||||
$this->default = app('amount')->getDefaultCurrencyByUserGroup(auth()->user()->userGroup);
|
||||
$this->converter = new ExchangeRateConverter();
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@ use stdClass;
|
||||
*/
|
||||
class TransactionGroupTransformer extends AbstractTransformer
|
||||
{
|
||||
use ConvertsExchangeRates;
|
||||
|
||||
private ExchangeRateConverter $converter;
|
||||
private array $currencies = [];
|
||||
|
||||
Reference in New Issue
Block a user