[chore] fix phpstan errors.

This commit is contained in:
James Cole
2025-01-19 19:07:19 +01:00
parent 6e836aceec
commit 053b46ae63
52 changed files with 68 additions and 108 deletions

View File

@@ -50,7 +50,7 @@ class AccountTransformer extends AbstractTransformer
$this->parameters = new ParameterBag();
$this->repository = app(AccountRepositoryInterface::class);
$this->convertToNative = Amount::convertToNative();
$this->default = Amount::getDefaultCurrency();
$this->default = Amount::getNativeCurrency();
}
/**
@@ -72,7 +72,7 @@ class AccountTransformer extends AbstractTransformer
$convertToNative = Amount::convertToNative();
// get account role (will only work if the type is asset).
$default = Amount::getDefaultCurrency();
$default = Amount::getNativeCurrency();
$accountRole = $this->getAccountRole($account, $accountType);
$date = $this->getDate();
$date->endOfDay();

View File

@@ -50,7 +50,7 @@ class AvailableBudgetTransformer extends AbstractTransformer
$this->repository = app(BudgetRepositoryInterface::class);
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->noBudgetRepository = app(NoBudgetRepositoryInterface::class);
$this->default = Amount::getDefaultCurrency();
$this->default = Amount::getNativeCurrency();
$this->convertToNative = Amount::convertToNative();
}

View File

@@ -52,7 +52,7 @@ class BillTransformer extends AbstractTransformer
{
$this->repository = app(BillRepositoryInterface::class);
$this->calculator = app(BillDateCalculator::class);
$this->default = Amount::getDefaultCurrency();
$this->default = Amount::getNativeCurrency();
$this->convertToNative = Amount::convertToNative();
}

View File

@@ -47,7 +47,7 @@ class BudgetLimitTransformer extends AbstractTransformer
public function __construct()
{
$this->default = Amount::getDefaultCurrency();
$this->default = Amount::getNativeCurrency();
$this->convertToNative = Amount::convertToNative();
}

View File

@@ -51,7 +51,7 @@ class BudgetTransformer extends AbstractTransformer
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->repository = app(BudgetRepositoryInterface::class);
$this->parameters = new ParameterBag();
$this->default = Amount::getDefaultCurrency();
$this->default = Amount::getNativeCurrency();
$this->convertToNative = Amount::convertToNative();
}

View File

@@ -48,7 +48,7 @@ class CategoryTransformer extends AbstractTransformer
{
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->repository = app(CategoryRepositoryInterface::class);
$this->default = Amount::getDefaultCurrency();
$this->default = Amount::getNativeCurrency();
$this->convertToNative = Amount::convertToNative();
}

View File

@@ -135,7 +135,7 @@ class AccountTransformer extends AbstractTransformer
private function getDefaultCurrency(): void
{
$this->default = app('amount')->getDefaultCurrency();
$this->default = app('amount')->getNativeCurrency();
}
private function collectAccountMetaData(Collection $accounts): void

View File

@@ -97,7 +97,7 @@ class BillTransformer extends AbstractTransformer
];
}
Log::debug(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
$this->default = app('amount')->getDefaultCurrency();
$this->default = app('amount')->getNativeCurrency();
$this->converter = new ExchangeRateConverter();
// grab all paid dates:

View File

@@ -156,7 +156,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')->getNativeCurrencyByUser($account->user);
// note
// $notes = $this->piggyRepos->getNoteText($piggyBank);

View File

@@ -79,7 +79,7 @@ class TransactionGroupTransformer extends AbstractTransformer
}
}
$this->default = app('amount')->getDefaultCurrency();
$this->default = app('amount')->getNativeCurrency();
$this->converter = new ExchangeRateConverter();
$this->collectAllMetaData();