Optimise code.

This commit is contained in:
James Cole
2020-10-24 17:27:36 +02:00
parent b3f1737495
commit 3979e12043
21 changed files with 199 additions and 187 deletions

View File

@@ -47,8 +47,7 @@ use Log;
*/
class MassController extends Controller
{
/** @var JournalRepositoryInterface Journals and transactions overview */
private $repository;
private JournalRepositoryInterface $repository;
/**
* MassController constructor.
@@ -131,16 +130,16 @@ class MassController extends Controller
{
$subTitle = (string) trans('firefly.mass_edit_journals');
/** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepositoryInterface::class);
/** @var AccountRepositoryInterface $accountRepository */
$accountRepository = app(AccountRepositoryInterface::class);
// valid withdrawal sources:
$array = array_keys(config(sprintf('firefly.source_dests.%s', TransactionType::WITHDRAWAL)));
$withdrawalSources = $repository->getAccountsByType($array);
$withdrawalSources = $accountRepository->getAccountsByType($array);
// valid deposit destinations:
$array = config(sprintf('firefly.source_dests.%s.%s', TransactionType::DEPOSIT, AccountType::REVENUE));
$depositDestinations = $repository->getAccountsByType($array);
$depositDestinations = $accountRepository->getAccountsByType($array);
/** @var BudgetRepositoryInterface $budgetRepository */
$budgetRepository = app(BudgetRepositoryInterface::class);