Various code cleanup.

This commit is contained in:
James Cole
2017-02-17 06:42:36 +01:00
parent 1d979778e8
commit 5d0cdc4ffa
31 changed files with 168 additions and 169 deletions

View File

@@ -52,9 +52,9 @@ class SetBudget implements ActionInterface
/** @var BudgetRepositoryInterface $repository */
$repository = app(BudgetRepositoryInterface::class);
$repository->setUser($journal->user);
$search = $this->action->action_value;
$budgets = $repository->getActiveBudgets();
$budget = $budgets->filter(
$search = $this->action->action_value;
$budgets = $repository->getActiveBudgets();
$budget = $budgets->filter(
function (Budget $current) use ($search) {
return $current->name == $search;
}

View File

@@ -62,7 +62,7 @@ class SetDestinationAccount implements ActionInterface
$this->journal = $journal;
$this->repository = app(AccountRepositoryInterface::class);
$this->repository->setUser($journal->user);
$count = $journal->transactions()->count();
$count = $journal->transactions()->count();
if ($count > 2) {
Log::error(sprintf('Cannot change destination account of journal #%d because it is a split journal.', $journal->id));

View File

@@ -62,7 +62,7 @@ class SetSourceAccount implements ActionInterface
$this->journal = $journal;
$this->repository = app(AccountRepositoryInterface::class);
$this->repository->setUser($journal->user);
$count = $journal->transactions()->count();
$count = $journal->transactions()->count();
if ($count > 2) {
Log::error(sprintf('Cannot change source account of journal #%d because it is a split journal.', $journal->id));

View File

@@ -75,7 +75,6 @@ class AbstractTrigger
}
/**
* @param RuleTrigger $trigger
* @param TransactionJournal $journal