Move method to correct repository.

This commit is contained in:
James Cole
2019-08-30 08:09:39 +02:00
parent 7685e2007f
commit 09bc50dd4d
7 changed files with 101 additions and 114 deletions

View File

@@ -61,11 +61,6 @@ interface BudgetLimitRepositoryInterface
*/
public function getAllBudgetLimitsByCurrency(TransactionCurrency $currency, Carbon $start = null, Carbon $end = null): Collection;
/**
* @param User $user
*/
public function setUser(User $user): void;
/**
* @param Budget $budget
* @param Carbon $start
@@ -75,4 +70,9 @@ interface BudgetLimitRepositoryInterface
*/
public function getBudgetLimits(Budget $budget, Carbon $start = null, Carbon $end = null): Collection;
/**
* @param User $user
*/
public function setUser(User $user): void;
}

View File

@@ -36,7 +36,6 @@ use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Models\TransactionType;
use FireflyIII\Services\Internal\Destroy\BudgetDestroyService;
use FireflyIII\User;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Collection;
use Log;
use Navigation;
@@ -207,7 +206,6 @@ class BudgetRepository implements BudgetRepositoryInterface
return $set;
}
/**
* This method is being used to generate the budget overview in the year/multi-year report. Its used
* in both the year/multi-year budget overview AND in the accompanying chart.

View File

@@ -88,15 +88,6 @@ interface BudgetRepositoryInterface
*/
public function getActiveBudgets(): Collection;
/**
* @param Budget $budget
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
public function getBudgetLimits(Budget $budget, Carbon $start = null, Carbon $end = null): Collection;
/**
* @param Collection $budgets
* @param Collection $accounts

View File

@@ -176,9 +176,9 @@ class OperationsRepository implements OperationsRepositoryInterface
*/
private function getBudgetLimits(Budget $budget, Carbon $start = null, Carbon $end = null): Collection
{
/** @var BudgetRepositoryInterface $repository */
$repository = app(BudgetRepositoryInterface::class);
/** @var BudgetLimitRepositoryInterface $blRepository */
$blRepository = app(BudgetLimitRepositoryInterface::class);
return $repository->getBudgetLimits($budget, $start, $end);
return $blRepository->getBudgetLimits($budget, $start, $end);
}
}