mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 20:16:22 +00:00
chore: code cleanup.
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user