[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

@@ -118,7 +118,7 @@ abstract class Controller extends BaseController
$this->defaultCurrency =null;
// get shown-intro-preference:
if (auth()->check()) {
$this->defaultCurrency = Amount::getDefaultCurrency();
$this->defaultCurrency = Amount::getNativeCurrency();
$language = Steam::getLanguage();
$locale = Steam::getLocale();
$darkMode = app('preferences')->get('darkMode', 'browser')->data;

View File

@@ -42,8 +42,7 @@ class EditController extends Controller
$mainTitleIcon = 'fa-book';
app('log')->debug(sprintf('Now at %s', __METHOD__));
return view('administrations.edit') // @phpstan-ignore-line
->with(compact('title', 'subTitle', 'mainTitleIcon'))
return view('administrations.edit')->with(compact('title', 'subTitle', 'mainTitleIcon'))
;
}
}

View File

@@ -159,6 +159,7 @@ class InterestingMessage
/** @var User $user */
$user = auth()->user();
/** @var UserGroup|null $userGroup */
$userGroup = UserGroup::find($userGroupId);
$valid = false;
$memberships = $user->groupMemberships()->get();

View File

@@ -118,7 +118,7 @@ class Range
// save some formats:
$monthAndDayFormat = (string) trans('config.month_and_day_js', [], $locale);
$dateTimeFormat = (string) trans('config.date_time_js', [], $locale);
$defaultCurrency = Amount::getDefaultCurrency();
$defaultCurrency = Amount::getNativeCurrency();
// also format for moment JS:
$madMomentJS = (string) trans('config.month_and_day_moment_js', [], $locale);

View File

@@ -126,7 +126,7 @@ class PiggyBankStoreRequest extends FormRequest
$currencyId = (int) ($data['transaction_currency_id'] ?? 0);
$currency = TransactionCurrency::find($currencyId);
if (null === $currency) {
return Amount::getDefaultCurrency();
return Amount::getNativeCurrency();
}
return $currency;

View File

@@ -129,7 +129,7 @@ class PiggyBankUpdateRequest extends FormRequest
$currencyId = (int) ($data['transaction_currency_id'] ?? 0);
$currency = TransactionCurrency::find($currencyId);
if (null === $currency) {
return Amount::getDefaultCurrency();
return Amount::getNativeCurrency();
}
return $currency;