Code cleanup

This commit is contained in:
James Cole
2021-03-21 09:15:40 +01:00
parent da1751940e
commit 206845575c
317 changed files with 7418 additions and 7362 deletions

View File

@@ -37,13 +37,13 @@ use Illuminate\Support\Collection;
*/
class FrontpageChartGenerator
{
private User $user;
private Carbon $start;
private Carbon $end;
private BudgetRepositoryInterface $budgetRepository;
private BudgetLimitRepositoryInterface $blRepository;
protected OperationsRepositoryInterface $opsRepository;
private BudgetLimitRepositoryInterface $blRepository;
private BudgetRepositoryInterface $budgetRepository;
private Carbon $end;
private string $monthAndDayFormat;
private Carbon $start;
private User $user;
/**
* FrontpageChartGenerator constructor.
@@ -79,38 +79,6 @@ class FrontpageChartGenerator
return $data;
}
/**
* A basic setter for the user. Also updates the repositories with the right user.
*
* @param User $user
*/
public function setUser(User $user): void
{
$this->user = $user;
$this->budgetRepository->setUser($user);
$this->blRepository->setUser($user);
$this->opsRepository->setUser($user);
$locale = app('steam')->getLocale();
$this->monthAndDayFormat = (string)trans('config.month_and_day', [], $locale);
}
/**
* @param Carbon $start
*/
public function setStart(Carbon $start): void
{
$this->start = $start;
}
/**
* @param Carbon $end
*/
public function setEnd(Carbon $end): void
{
$this->end = $end;
}
/**
* For each budget, gets all budget limits for the current time range.
* When no limits are present, the time range is used to collect information on money spent.
@@ -238,5 +206,37 @@ class FrontpageChartGenerator
return $data;
}
/**
* @param Carbon $end
*/
public function setEnd(Carbon $end): void
{
$this->end = $end;
}
/**
* @param Carbon $start
*/
public function setStart(Carbon $start): void
{
$this->start = $start;
}
/**
* A basic setter for the user. Also updates the repositories with the right user.
*
* @param User $user
*/
public function setUser(User $user): void
{
$this->user = $user;
$this->budgetRepository->setUser($user);
$this->blRepository->setUser($user);
$this->opsRepository->setUser($user);
$locale = app('steam')->getLocale();
$this->monthAndDayFormat = (string)trans('config.month_and_day', [], $locale);
}
}