Various code cleanup.

This commit is contained in:
James Cole
2021-05-24 08:54:58 +02:00
parent 815fd5ff6b
commit d60650cff2
63 changed files with 134 additions and 88 deletions

View File

@@ -168,10 +168,10 @@ class CategoryController extends Controller
/**
* Generate report chart for either with or without category.
*
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
* @param Category $category
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
* @param Category|null $category
*
* @return array
*/

View File

@@ -184,7 +184,7 @@ class ExpenseReportController extends Controller
$newSet = [];
foreach ($chartData as $key => $entry) {
if (0 === !array_sum($entry['entries'])) {
$newSet[$key] = $chartData[$key];
$newSet[$key] = $entry;
}
}
if (0===count($newSet)) {

View File

@@ -94,7 +94,6 @@ class PiggyBankController extends Controller
$chartData = [];
while ($oldest <= $today) {
/** @var Collection $filtered */
$filtered = $set->filter(
function (PiggyBankEvent $event) use ($oldest) {
return $event->date->lte($oldest);
@@ -105,7 +104,6 @@ class PiggyBankController extends Controller
$chartData[$label] = $currentSum;
$oldest = app('navigation')->addPeriod($oldest, $step, 0);
}
/** @var Collection $finalFiltered */
$finalFiltered = $set->filter(
function (PiggyBankEvent $event) use ($today) {
return $event->date->lte($today);