Refactor phpstan errors.

This commit is contained in:
James Cole
2023-10-29 17:41:14 +01:00
parent 5e32878d01
commit 12675dd950
60 changed files with 297 additions and 386 deletions

View File

@@ -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: