Reformat various code.

This commit is contained in:
James Cole
2022-03-29 14:58:06 +02:00
parent 1209c4e76a
commit 29bed2547c
140 changed files with 1004 additions and 1010 deletions

View File

@@ -59,7 +59,7 @@ class EditController extends Controller
$this->middleware(
function ($request, $next) {
app('view')->share('mainTitleIcon', 'fa-credit-card');
app('view')->share('title', (string)trans('firefly.accounts'));
app('view')->share('title', (string) trans('firefly.accounts'));
$this->repository = app(AccountRepositoryInterface::class);
$this->currencyRepos = app(CurrencyRepositoryInterface::class);
@@ -86,7 +86,7 @@ class EditController extends Controller
}
$objectType = config('firefly.shortNamesByFullName')[$account->accountType->type];
$subTitle = (string)trans(sprintf('firefly.edit_%s_account', $objectType), ['name' => $account->name]);
$subTitle = (string) trans(sprintf('firefly.edit_%s_account', $objectType), ['name' => $account->name]);
$subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $objectType));
$roles = $this->getRoles();
$liabilityTypes = $this->getLiabilityTypes();
@@ -111,9 +111,9 @@ class EditController extends Controller
// interest calculation periods:
$interestPeriods = [
'daily' => (string)trans('firefly.interest_calc_daily'),
'monthly' => (string)trans('firefly.interest_calc_monthly'),
'yearly' => (string)trans('firefly.interest_calc_yearly'),
'daily' => (string) trans('firefly.interest_calc_daily'),
'monthly' => (string) trans('firefly.interest_calc_monthly'),
'yearly' => (string) trans('firefly.interest_calc_yearly'),
];
// put previous url in session if not redirect from store (not "return_to_edit").
@@ -122,7 +122,7 @@ class EditController extends Controller
}
$request->session()->forget('accounts.edit.fromUpdate');
$openingBalanceAmount = (string)$repository->getOpeningBalanceAmount($account);
$openingBalanceAmount = (string) $repository->getOpeningBalanceAmount($account);
if ('0' === $openingBalanceAmount) {
$openingBalanceAmount = '';
}
@@ -143,17 +143,17 @@ class EditController extends Controller
'BIC' => $repository->getMetaValue($account, 'BIC'),
'opening_balance_date' => $openingBalanceDate,
'liability_type_id' => $account->account_type_id,
'opening_balance' => number_format((float)$openingBalanceAmount, $currency->decimal_places,'.',''),
'opening_balance' => number_format((float) $openingBalanceAmount, $currency->decimal_places, '.', ''),
'liability_direction' => $this->repository->getMetaValue($account, 'liability_direction'),
'virtual_balance' => number_format((float)$account->virtual_balance, $currency->decimal_places,'.',''),
'virtual_balance' => number_format((float) $account->virtual_balance, $currency->decimal_places, '.', ''),
'currency_id' => $currency->id,
'include_net_worth' => $includeNetWorth,
'interest' => $repository->getMetaValue($account, 'interest'),
'interest_period' => $repository->getMetaValue($account, 'interest_period'),
'notes' => $this->repository->getNoteText($account),
'active' => $hasOldInput ? (bool)$request->old('active') : $account->active,
'active' => $hasOldInput ? (bool) $request->old('active') : $account->active,
];
if('' === $openingBalanceAmount) {
if ('' === $openingBalanceAmount) {
$preFilled['opening_balance'] = '';
}
@@ -194,7 +194,7 @@ class EditController extends Controller
$data = $request->getAccountData();
$this->repository->update($account, $data);
$request->session()->flash('success', (string)trans('firefly.updated_account', ['name' => $account->name]));
$request->session()->flash('success', (string) trans('firefly.updated_account', ['name' => $account->name]));
// store new attachment(s):
@@ -203,7 +203,7 @@ class EditController extends Controller
$this->attachments->saveAttachmentsForModel($account, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
session()->flash('info', (string)trans('firefly.no_att_demo_user'));
session()->flash('info', (string) trans('firefly.no_att_demo_user'));
}
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
@@ -212,7 +212,7 @@ class EditController extends Controller
// redirect
$redirect = redirect($this->getPreviousUri('accounts.edit.uri'));
if (1 === (int)$request->get('return_to_edit')) {
if (1 === (int) $request->get('return_to_edit')) {
// set value so edit routine will not overwrite URL:
$request->session()->put('accounts.edit.fromUpdate', true);