Remove unused methods.

This commit is contained in:
James Cole
2018-07-22 21:09:57 +02:00
parent a616e06f9d
commit 67ea825d4a
26 changed files with 13 additions and 929 deletions

View File

@@ -161,20 +161,6 @@ class BudgetRepository implements BudgetRepositoryInterface
return $return;
}
/**
* Deletes a budget limit.
*
* @param BudgetLimit $budgetLimit
*/
public function deleteBudgetLimit(BudgetLimit $budgetLimit): void
{
try {
$budgetLimit->delete();
} catch (Exception $e) {
Log::error(sprintf('Could not delete budget limit: %s', $e->getMessage()));
}
}
/**
* @param Budget $budget
*
@@ -217,57 +203,6 @@ class BudgetRepository implements BudgetRepositoryInterface
}
}
/**
* Filters entries from the result set generated by getBudgetPeriodReport.
*
* @param Collection $set
* @param int $budgetId
* @param array $periods
*
* @return array
*/
public function filterAmounts(Collection $set, int $budgetId, array $periods): array
{
$arr = [];
$keys = array_keys($periods);
foreach ($keys as $period) {
/** @var stdClass $object */
$result = $set->filter(
function (TransactionJournal $object) use ($budgetId, $period) {
$result = (string)$object->period_marker === (string)$period && $budgetId === (int)$object->budget_id;
return $result;
}
);
$amount = '0';
if (null !== $result->first()) {
$amount = $result->first()->sum_of_period;
}
$arr[$period] = $amount;
}
return $arr;
}
/**
* Find a budget.
*
* @param int $budgetId
*
* @return Budget
* @deprecated
*/
public function find(int $budgetId): Budget
{
$budget = $this->user->budgets()->find($budgetId);
if (null === $budget) {
$budget = new Budget;
}
return $budget;
}
/**
* Find a budget.
*