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

@@ -64,7 +64,7 @@ class ReportController extends Controller
$this->middleware(
function ($request, $next) {
app('view')->share('title', (string)trans('firefly.reports'));
app('view')->share('title', (string) trans('firefly.reports'));
app('view')->share('mainTitleIcon', 'fa-bar-chart');
app('view')->share('subTitleIcon', 'fa-calendar');
$this->helper = app(ReportHelperInterface::class);
@@ -89,7 +89,7 @@ class ReportController extends Controller
public function auditReport(Collection $accounts, Carbon $start, Carbon $end)
{
if ($end < $start) {
return view('error')->with('message', (string)trans('firefly.end_after_start_date'));
return view('error')->with('message', (string) trans('firefly.end_after_start_date'));
}
$this->repository->cleanupBudgets();
@@ -125,7 +125,7 @@ class ReportController extends Controller
public function budgetReport(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end)
{
if ($end < $start) {
return view('error')->with('message', (string)trans('firefly.end_after_start_date'));
return view('error')->with('message', (string) trans('firefly.end_after_start_date'));
}
$this->repository->cleanupBudgets();
@@ -162,7 +162,7 @@ class ReportController extends Controller
public function categoryReport(Collection $accounts, Collection $categories, Carbon $start, Carbon $end)
{
if ($end < $start) {
return view('error')->with('message', (string)trans('firefly.end_after_start_date'));
return view('error')->with('message', (string) trans('firefly.end_after_start_date'));
}
$this->repository->cleanupBudgets();
@@ -198,7 +198,7 @@ class ReportController extends Controller
public function defaultReport(Collection $accounts, Carbon $start, Carbon $end)
{
if ($end < $start) {
return view('error')->with('message', (string)trans('firefly.end_after_start_date'));
return view('error')->with('message', (string) trans('firefly.end_after_start_date'));
}
$this->repository->cleanupBudgets();
@@ -244,7 +244,7 @@ class ReportController extends Controller
trans(
'firefly.report_double',
['start' => $start->isoFormat($this->monthAndDayFormat),
'end' => $end->isoFormat($this->monthAndDayFormat)]
'end' => $end->isoFormat($this->monthAndDayFormat)]
)
);
@@ -342,37 +342,37 @@ class ReportController extends Controller
if (0 === $request->getAccountList()->count()) {
Log::debug('Account count is zero');
session()->flash('error', (string)trans('firefly.select_at_least_one_account'));
session()->flash('error', (string) trans('firefly.select_at_least_one_account'));
return redirect(route('reports.index'));
}
if ('category' === $reportType && 0 === $request->getCategoryList()->count()) {
session()->flash('error', (string)trans('firefly.select_at_least_one_category'));
session()->flash('error', (string) trans('firefly.select_at_least_one_category'));
return redirect(route('reports.index'));
}
if ('budget' === $reportType && 0 === $request->getBudgetList()->count()) {
session()->flash('error', (string)trans('firefly.select_at_least_one_budget'));
session()->flash('error', (string) trans('firefly.select_at_least_one_budget'));
return redirect(route('reports.index'));
}
if ('tag' === $reportType && 0 === $request->getTagList()->count()) {
session()->flash('error', (string)trans('firefly.select_at_least_one_tag'));
session()->flash('error', (string) trans('firefly.select_at_least_one_tag'));
return redirect(route('reports.index'));
}
if ('double' === $reportType && 0 === $request->getDoubleList()->count()) {
session()->flash('error', (string)trans('firefly.select_at_least_one_expense'));
session()->flash('error', (string) trans('firefly.select_at_least_one_expense'));
return redirect(route('reports.index'));
}
if ($request->getEndDate() < $request->getStartDate()) {
return view('error')->with('message', (string)trans('firefly.end_after_start_date'));
return view('error')->with('message', (string) trans('firefly.end_after_start_date'));
}
$uri = match ($reportType) {
@@ -401,7 +401,7 @@ class ReportController extends Controller
public function tagReport(Collection $accounts, Collection $tags, Carbon $start, Carbon $end)
{
if ($end < $start) {
return view('error')->with('message', (string)trans('firefly.end_after_start_date'));
return view('error')->with('message', (string) trans('firefly.end_after_start_date'));
}
$this->repository->cleanupBudgets();