Code cleanup.

This commit is contained in:
James Cole
2023-12-20 19:35:52 +01:00
parent c4f6366642
commit 64ec0cf62e
997 changed files with 12908 additions and 28136 deletions

View File

@@ -54,8 +54,6 @@ class ShowController extends Controller
/**
* BillController constructor.
*
*/
public function __construct()
{
@@ -77,10 +75,7 @@ class ShowController extends Controller
/**
* Rescan bills for transactions.
*
* @param Request $request
* @param Bill $bill
*
* @return RedirectResponse|Redirector
* @return Redirector|RedirectResponse
*/
public function rescan(Request $request, Bill $bill)
{
@@ -117,10 +112,8 @@ class ShowController extends Controller
/**
* Show a bill.
*
* @param Request $request
* @param Bill $bill
*
* @return Factory|View
*
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
@@ -129,8 +122,10 @@ class ShowController extends Controller
// add info about rules:
$rules = $this->repository->getRulesForBill($bill);
$subTitle = $bill->name;
/** @var Carbon $start */
$start = session('start');
/** @var Carbon $end */
$end = session('end');
$year = $start->year;
@@ -159,11 +154,11 @@ class ShowController extends Controller
$object = $manager->createData($resource)->toArray();
$object['data']['currency'] = $bill->transactionCurrency;
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
$collector->setBill($bill)->setLimit($pageSize)->setPage($page)->withBudgetInformation()
->withCategoryInformation()->withAccountInformation();
->withCategoryInformation()->withAccountInformation()
;
$groups = $collector->getPaginatedGroups();
$groups->setPath(route('bills.show', [$bill->id]));
@@ -171,7 +166,6 @@ class ShowController extends Controller
$collection = $this->repository->getAttachments($bill);
$attachments = new Collection();
if ($collection->count() > 0) {
/** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class);
@@ -182,7 +176,6 @@ class ShowController extends Controller
);
}
return view('bills.show', compact('attachments', 'groups', 'rules', 'yearAverage', 'overallAverage', 'year', 'object', 'bill', 'subTitle'));
}
}