chore: code cleanup.

This commit is contained in:
James Cole
2023-05-29 13:56:55 +02:00
parent 7f7644c92f
commit 1b52147a05
295 changed files with 12418 additions and 12324 deletions

View File

@@ -52,16 +52,6 @@ class BudgetLimitHandler
$this->updateAvailableBudget($event->budgetLimit);
}
/**
* @param Updated $event
* @return void
*/
public function updated(Updated $event): void
{
Log::debug(sprintf('BudgetLimitHandler::updated(#%s)', $event->budgetLimit->id));
$this->updateAvailableBudget($event->budgetLimit);
}
/**
* @param Deleted $event
* @return void
@@ -74,6 +64,16 @@ class BudgetLimitHandler
$this->updateAvailableBudget($event->budgetLimit);
}
/**
* @param Updated $event
* @return void
*/
public function updated(Updated $event): void
{
Log::debug(sprintf('BudgetLimitHandler::updated(#%s)', $event->budgetLimit->id));
$this->updateAvailableBudget($event->budgetLimit);
}
/**
* @param AvailableBudget $availableBudget
* @return void
@@ -182,12 +182,12 @@ class BudgetLimitHandler
$end = app('navigation')->startOfPeriod($budgetLimit->end_date, $viewRange);
$end = app('navigation')->endOfPeriod($end, $viewRange);
$budget = Budget::find($budgetLimit->budget_id);
if(null === $budget) {
if (null === $budget) {
Log::warning('Budget is null, cannot continue.');
$budgetLimit->forceDelete();
return;
}
$user = $budget->user;
$user = $budget->user;
// sanity check. It happens when the budget has been deleted so the original user is unknown.
if (null === $user) {