Code cleanup.

This commit is contained in:
James Cole
2016-05-01 15:05:29 +02:00
parent b80db054e2
commit 5e1167b8ae
28 changed files with 40 additions and 35 deletions

View File

@@ -87,7 +87,7 @@ class ReportController extends Controller
$budget = $budgetRepository->find(intval($attributes['budgetId']));
/** @var AccountRepositoryInterface $accountRepository */
$accountRepository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface');
$accountRepository = app(AccountRepositoryInterface::class);
$account = $accountRepository->find(intval($attributes['accountId']));
switch (true) {
@@ -177,7 +177,7 @@ class ReportController extends Controller
private function expenseEntry(array $attributes): string
{
/** @var AccountRepositoryInterface $repository */
$repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface');
$repository = app(AccountRepositoryInterface::class);
$account = $repository->find(intval($attributes['accountId']));
$journals = $repository->getExpensesByDestination($account, $attributes['accounts'], $attributes['startDate'], $attributes['endDate']);
$view = view('popup.report.expense-entry', compact('journals', 'account'))->render();
@@ -196,7 +196,7 @@ class ReportController extends Controller
private function incomeEntry(array $attributes): string
{
/** @var AccountRepositoryInterface $repository */
$repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface');
$repository = app(AccountRepositoryInterface::class);
$account = $repository->find(intval($attributes['accountId']));
$journals = $repository->getIncomeByDestination($account, $attributes['accounts'], $attributes['startDate'], $attributes['endDate']);
$view = view('popup.report.income-entry', compact('journals', 'account'))->render();

View File

@@ -147,7 +147,7 @@ class ReportController extends Controller
private function auditReport(Carbon $start, Carbon $end, Collection $accounts)
{
/** @var ARI $repos */
$repos = app('FireflyIII\Repositories\Account\AccountRepositoryInterface');
$repos = app(ARI::class);
$auditData = [];
$dayBefore = clone $start;
$dayBefore->subDay();

View File

@@ -289,7 +289,7 @@ class TransactionController extends Controller
{
$subTitle = trans('firefly.mass_edit_journals');
/** @var ARI $accountRepository */
$accountRepository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface');
$accountRepository = app(ARI::class);
$accountList = ExpandedForm::makeSelectList($accountRepository->getAccounts(['Default account', 'Asset account']));
// put previous url in session