From 73e32ecdcbaefeae9fe5b8dbabc6ac69dbd45e95 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 15 Jul 2018 15:45:45 +0200 Subject: [PATCH] Refer to correct repositories. --- app/Http/Controllers/Account/DeleteController.php | 3 +-- app/Http/Controllers/Account/ReconcileController.php | 5 ++--- app/Http/Controllers/Category/ShowController.php | 2 +- app/Http/Controllers/CategoryController.php | 2 +- app/Http/Controllers/Recurring/IndexController.php | 6 ++++-- app/Http/Controllers/Transaction/BulkController.php | 3 +-- app/Http/Controllers/Transaction/SingleController.php | 5 ++--- app/Http/Controllers/Transaction/SplitController.php | 3 +-- 8 files changed, 13 insertions(+), 16 deletions(-) diff --git a/app/Http/Controllers/Account/DeleteController.php b/app/Http/Controllers/Account/DeleteController.php index 0aa7532b17..e74cd1264b 100644 --- a/app/Http/Controllers/Account/DeleteController.php +++ b/app/Http/Controllers/Account/DeleteController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Account; -use ExpandedForm; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Account; use FireflyIII\Repositories\Account\AccountRepositoryInterface; @@ -68,7 +67,7 @@ class DeleteController extends Controller { $typeName = config('firefly.shortNamesByFullName.' . $account->accountType->type); $subTitle = (string)trans('firefly.delete_' . $typeName . '_account', ['name' => $account->name]); - $accountList = ExpandedForm::makeSelectListWithEmpty($this->repository->getAccountsByType([$account->accountType->type])); + $accountList = app('expandedform')->makeSelectListWithEmpty($this->repository->getAccountsByType([$account->accountType->type])); unset($accountList[$account->id]); // put previous url in session diff --git a/app/Http/Controllers/Account/ReconcileController.php b/app/Http/Controllers/Account/ReconcileController.php index 62c670e23f..ee8cfce3c6 100644 --- a/app/Http/Controllers/Account/ReconcileController.php +++ b/app/Http/Controllers/Account/ReconcileController.php @@ -36,7 +36,6 @@ use FireflyIII\Models\TransactionType; use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use FireflyIII\Repositories\Journal\JournalRepositoryInterface; -use FireflyIII\Services\Internal\Update\CurrencyUpdateService; use Log; /** @@ -46,9 +45,9 @@ use Log; */ class ReconcileController extends Controller { - /** @var CurrencyUpdateService */ - private $accountRepos; /** @var AccountRepositoryInterface */ + private $accountRepos; + /** @var CurrencyRepositoryInterface */ private $currencyRepos; /** @var JournalRepositoryInterface */ private $repository; diff --git a/app/Http/Controllers/Category/ShowController.php b/app/Http/Controllers/Category/ShowController.php index b7712d54de..81132d4b69 100644 --- a/app/Http/Controllers/Category/ShowController.php +++ b/app/Http/Controllers/Category/ShowController.php @@ -127,7 +127,7 @@ class ShowController extends Controller $pageSize = (int)app('preferences')->get('listPageSize', 50)->data; $start = null; $end = null; - $periods = new Collection; + $periods = new Collection; $moment = 'all'; $subTitle = (string)trans('firefly.all_journals_for_category', ['name' => $category->name]); diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index 1940a8b439..c8924e0c7f 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -66,7 +66,7 @@ class CategoryController extends Controller $this->rememberPreviousUri('categories.create.uri'); } $request->session()->forget('categories.create.fromStore'); - $subTitle =(string)trans('firefly.create_new_category'); + $subTitle = (string)trans('firefly.create_new_category'); return view('categories.create', compact('subTitle')); } diff --git a/app/Http/Controllers/Recurring/IndexController.php b/app/Http/Controllers/Recurring/IndexController.php index a731fd61ea..07d6489d5f 100644 --- a/app/Http/Controllers/Recurring/IndexController.php +++ b/app/Http/Controllers/Recurring/IndexController.php @@ -226,8 +226,10 @@ class IndexController extends Controller $yearlyDate = $date->formatLocalized(trans('config.month_and_day_no_year')); $result = [ 'daily' => ['label' => (string)trans('firefly.recurring_daily'), 'selected' => 0 === strpos($preSelected, 'daily')], - $weekly => ['label' => (string)trans('firefly.recurring_weekly', ['weekday' => $dayOfWeek]), 'selected' => 0 === strpos($preSelected, 'weekly')], - $monthly => ['label' => (string)trans('firefly.recurring_monthly', ['dayOfMonth' => $date->day]), 'selected' => 0 === strpos($preSelected, 'monthly')], + $weekly => ['label' => (string)trans('firefly.recurring_weekly', ['weekday' => $dayOfWeek]), + 'selected' => 0 === strpos($preSelected, 'weekly')], + $monthly => ['label' => (string)trans('firefly.recurring_monthly', ['dayOfMonth' => $date->day]), + 'selected' => 0 === strpos($preSelected, 'monthly')], $ndom => ['label' => (string)trans('firefly.recurring_ndom', ['weekday' => $dayOfWeek, 'dayOfMonth' => $date->weekOfMonth]), 'selected' => 0 === strpos($preSelected, 'ndom')], $yearly => ['label' => (string)trans('firefly.recurring_yearly', ['date' => $yearlyDate]), 'selected' => 0 === strpos($preSelected, 'yearly')], diff --git a/app/Http/Controllers/Transaction/BulkController.php b/app/Http/Controllers/Transaction/BulkController.php index 6237993e00..2a2a603779 100644 --- a/app/Http/Controllers/Transaction/BulkController.php +++ b/app/Http/Controllers/Transaction/BulkController.php @@ -24,7 +24,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; -use ExpandedForm; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Http\Requests\BulkEditJournalRequest; use FireflyIII\Models\TransactionJournal; @@ -72,7 +71,7 @@ class BulkController extends Controller // get list of budgets: /** @var BudgetRepositoryInterface $repository */ $repository = app(BudgetRepositoryInterface::class); - $budgetList = ExpandedForm::makeSelectListWithEmpty($repository->getActiveBudgets()); + $budgetList = app('expandedform')->makeSelectListWithEmpty($repository->getActiveBudgets()); // collect some useful meta data for the mass edit: $journals->each( function (TransactionJournal $journal) { diff --git a/app/Http/Controllers/Transaction/SingleController.php b/app/Http/Controllers/Transaction/SingleController.php index 3fa181ec25..1b7547ba20 100644 --- a/app/Http/Controllers/Transaction/SingleController.php +++ b/app/Http/Controllers/Transaction/SingleController.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; use Carbon\Carbon; -use ExpandedForm; use FireflyIII\Events\StoredTransactionJournal; use FireflyIII\Events\UpdatedTransactionJournal; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; @@ -143,7 +142,7 @@ class SingleController extends Controller { $what = strtolower($what ?? TransactionType::DEPOSIT); $what = (string)($request->old('what') ?? $what); - $budgets = ExpandedForm::makeSelectListWithEmpty($this->budgets->getActiveBudgets()); + $budgets = app('expandedform')->makeSelectListWithEmpty($this->budgets->getActiveBudgets()); $preFilled = session()->has('preFilled') ? session('preFilled') : []; $subTitle = (string)trans('form.add_new_' . $what); $subTitleIcon = 'fa-plus'; @@ -250,7 +249,7 @@ class SingleController extends Controller } $what = strtolower($transactionType); - $budgetList = ExpandedForm::makeSelectListWithEmpty($this->budgets->getBudgets()); + $budgetList = app('expandedform')->makeSelectListWithEmpty($this->budgets->getBudgets()); // view related code $subTitle = (string)trans('breadcrumbs.edit_journal', ['description' => $journal->description]); diff --git a/app/Http/Controllers/Transaction/SplitController.php b/app/Http/Controllers/Transaction/SplitController.php index 86e75acede..5b8c69b9c6 100644 --- a/app/Http/Controllers/Transaction/SplitController.php +++ b/app/Http/Controllers/Transaction/SplitController.php @@ -22,7 +22,6 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers\Transaction; -use ExpandedForm; use FireflyIII\Events\UpdatedTransactionJournal; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; @@ -98,7 +97,7 @@ class SplitController extends Controller // lists and collections $currencies = $this->currencies->get(); - $budgets = ExpandedForm::makeSelectListWithEmpty($this->budgets->getActiveBudgets()); + $budgets = app('expandedform')->makeSelectListWithEmpty($this->budgets->getActiveBudgets()); // other fields $optionalFields = app('preferences')->get('transaction_journal_optional_fields', [])->data;