Code cleanup

This commit is contained in:
James Cole
2024-12-22 08:43:12 +01:00
parent 5751f7e5a3
commit 565bd87959
574 changed files with 4600 additions and 4604 deletions

View File

@@ -62,7 +62,7 @@ class ShowController extends Controller
$this->middleware(
function ($request, $next) {
app('view')->share('title', (string)trans('firefly.bills'));
app('view')->share('title', (string) trans('firefly.bills'));
app('view')->share('mainTitleIcon', 'fa-calendar-o');
$this->repository = app(BillRepositoryInterface::class);
@@ -80,13 +80,13 @@ class ShowController extends Controller
{
$total = 0;
if (false === $bill->active) {
$request->session()->flash('warning', (string)trans('firefly.cannot_scan_inactive_bill'));
$request->session()->flash('warning', (string) trans('firefly.cannot_scan_inactive_bill'));
return redirect(route('bills.show', [$bill->id]));
}
$set = $this->repository->getRulesForBill($bill);
if (0 === $set->count()) {
$request->session()->flash('error', (string)trans('firefly.no_rules_for_bill'));
$request->session()->flash('error', (string) trans('firefly.no_rules_for_bill'));
return redirect(route('bills.show', [$bill->id]));
}
@@ -125,8 +125,8 @@ class ShowController extends Controller
/** @var Carbon $end */
$end = session('end');
$year = $start->year;
$page = (int)$request->get('page');
$pageSize = (int)app('preferences')->get('listPageSize', 50)->data;
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$yearAverage = $this->repository->getYearAverage($bill, $start);
$overallAverage = $this->repository->getOverallAverage($bill);
$manager = new Manager();