Various code cleanup.

This commit is contained in:
James Cole
2021-09-18 10:21:29 +02:00
parent 3589c9f60f
commit e829d79589
107 changed files with 225 additions and 220 deletions

View File

@@ -51,26 +51,14 @@ class ReportController extends Controller
app('view')->share('start', $attributes['startDate']);
app('view')->share('end', $attributes['endDate']);
switch ($attributes['location']) {
default:
$html = sprintf('Firefly III cannot handle "%s"-popups.', $attributes['location']);
break;
case 'budget-spent-amount':
$html = $this->budgetSpentAmount($attributes);
break;
case 'expense-entry':
$html = $this->expenseEntry($attributes);
break;
case 'income-entry':
$html = $this->incomeEntry($attributes);
break;
case 'category-entry':
$html = $this->categoryEntry($attributes);
break;
case 'budget-entry':
$html = $this->budgetEntry($attributes);
break;
}
$html = match ($attributes['location']) {
default => sprintf('Firefly III cannot handle "%s"-popups.', $attributes['location']),
'budget-spent-amount' => $this->budgetSpentAmount($attributes),
'expense-entry' => $this->expenseEntry($attributes),
'income-entry' => $this->incomeEntry($attributes),
'category-entry' => $this->categoryEntry($attributes),
'budget-entry' => $this->budgetEntry($attributes),
};
return response()->json(['html' => $html]);
}