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

@@ -61,7 +61,7 @@ class CreateController 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->attachments = app(AttachmentHelperInterface::class);
@@ -84,7 +84,7 @@ class CreateController extends Controller
$objectType = $objectType ?? 'asset';
$defaultCurrency = app('amount')->getDefaultCurrency();
$subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $objectType));
$subTitle = (string)trans(sprintf('firefly.make_new_%s_account', $objectType));
$subTitle = (string) trans(sprintf('firefly.make_new_%s_account', $objectType));
$roles = $this->getRoles();
$liabilityTypes = $this->getLiabilityTypes();
$hasOldInput = null !== $request->old('_token');
@@ -103,9 +103,9 @@ class CreateController 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'),
];
// pre fill some data
@@ -113,7 +113,7 @@ class CreateController extends Controller
'preFilled',
[
'currency_id' => $defaultCurrency->id,
'include_net_worth' => $hasOldInput ? (bool)$request->old('include_net_worth') : true,
'include_net_worth' => $hasOldInput ? (bool) $request->old('include_net_worth') : true,
]
);
@@ -142,7 +142,7 @@ class CreateController extends Controller
{
$data = $request->getAccountData();
$account = $this->repository->store($data);
$request->session()->flash('success', (string)trans('firefly.stored_new_account', ['name' => $account->name]));
$request->session()->flash('success', (string) trans('firefly.stored_new_account', ['name' => $account->name]));
app('preferences')->mark();
Log::channel('audit')->info('Stored new account.', $data);
@@ -161,7 +161,7 @@ class CreateController 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) {
@@ -170,7 +170,7 @@ class CreateController extends Controller
// redirect to previous URL.
$redirect = redirect($this->getPreviousUri('accounts.create.uri'));
if (1 === (int)$request->get('create_another')) {
if (1 === (int) $request->get('create_another')) {
// set value so create routine will not overwrite URL:
$request->session()->put('accounts.create.fromStore', true);