diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.php index 5628797153..84003aab26 100644 --- a/app/Http/Controllers/ExportController.php +++ b/app/Http/Controllers/ExportController.php @@ -22,7 +22,6 @@ use FireflyIII\Export\Processor; use FireflyIII\Http\Requests\ExportFormRequest; use FireflyIII\Models\AccountType; use FireflyIII\Models\ExportJob; -use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; use FireflyIII\Repositories\ExportJob\ExportJobRepositoryInterface as EJRI; use Preferences; use Response; @@ -117,20 +116,20 @@ class ExportController extends Controller } /** - * @param ExportFormRequest $request - * @param ARI $repository + * @param ExportFormRequest $request + * @param AccountCrudInterface $crud * - * @param EJRI $jobs + * @param EJRI $jobs * * @return string * @throws \FireflyIII\Exceptions\FireflyException */ - public function postIndex(ExportFormRequest $request, ARI $repository, EJRI $jobs) + public function postIndex(ExportFormRequest $request, AccountCrudInterface $crud, EJRI $jobs) { set_time_limit(0); $job = $jobs->findByKey($request->get('job')); $settings = [ - 'accounts' => $repository->get($request->get('accounts')), + 'accounts' => $crud->getAccountsById($request->get('accounts')), 'startDate' => new Carbon($request->get('export_start_range')), 'endDate' => new Carbon($request->get('export_end_range')), 'exportFormat' => $request->get('exportFormat'), diff --git a/app/Http/Controllers/RuleGroupController.php b/app/Http/Controllers/RuleGroupController.php index e1ffdec383..0998099348 100644 --- a/app/Http/Controllers/RuleGroupController.php +++ b/app/Http/Controllers/RuleGroupController.php @@ -21,7 +21,6 @@ use FireflyIII\Http\Requests\SelectTransactionsRequest; use FireflyIII\Jobs\ExecuteRuleGroupOnExistingTransactions; use FireflyIII\Models\AccountType; use FireflyIII\Models\RuleGroup; -use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface; use Input; use Preferences; @@ -147,16 +146,16 @@ class RuleGroupController extends Controller /** * Execute the given rulegroup on a set of existing transactions * - * @param SelectTransactionsRequest $request - * @param AccountRepositoryInterface $repository - * @param RuleGroup $ruleGroup + * @param SelectTransactionsRequest $request + * @param AccountCrudInterface $crud + * @param RuleGroup $ruleGroup * * @return \Illuminate\Http\RedirectResponse */ - public function execute(SelectTransactionsRequest $request, AccountRepositoryInterface $repository, RuleGroup $ruleGroup) + public function execute(SelectTransactionsRequest $request, AccountCrudInterface $crud, RuleGroup $ruleGroup) { // Get parameters specified by the user - $accounts = $repository->get($request->get('accounts')); + $accounts = $crud->getAccountsById($request->get('accounts')); $startDate = new Carbon($request->get('start_date')); $endDate = new Carbon($request->get('end_date')); diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index a1a13961cf..9d862039fc 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -227,18 +227,6 @@ class AccountRepository implements AccountRepositoryInterface return $first; } - /** - * Gets all the accounts by ID, for a given set. - * - * @param array $ids - * - * @return \Illuminate\Support\Collection - */ - public function get(array $ids): Collection - { - return $this->user->accounts()->whereIn('id', $ids)->get(['accounts.*']); - } - /** * @param TransactionJournal $journal * @param Account $account diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php index 255572fe3e..52b201fb1d 100644 --- a/app/Repositories/Account/AccountRepositoryInterface.php +++ b/app/Repositories/Account/AccountRepositoryInterface.php @@ -79,15 +79,6 @@ interface AccountRepositoryInterface */ public function firstUseDate(Account $account): Carbon; - /** - * Gets all the accounts by ID, for a given set. - * - * @param array $ids - * - * @return \Illuminate\Support\Collection - */ - public function get(array $ids): Collection; - /** * @param TransactionJournal $journal * @param Account $account