mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 22:58:09 +00:00
Various code optimalisations.
This commit is contained in:
@@ -107,7 +107,7 @@ class BudgetController extends Controller
|
||||
|
||||
while ($end >= $current) {
|
||||
$currentEnd = app('navigation')->endOfPeriod($current, $step);
|
||||
if ($step === '1Y') {
|
||||
if ('1Y' === $step) {
|
||||
$currentEnd->subDay(); // @codeCoverageIgnore
|
||||
}
|
||||
$spent = $this->repository->spentInPeriod($budgetCollection, new Collection, $current, $currentEnd);
|
||||
@@ -544,7 +544,7 @@ class BudgetController extends Controller
|
||||
$return[$name] = $row;
|
||||
}
|
||||
}
|
||||
unset($rows, $row);
|
||||
unset($rows);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -105,13 +105,13 @@ class PiggyBankController extends Controller
|
||||
$chartData[$label] = $currentSum;
|
||||
$oldest = app('navigation')->addPeriod($oldest, $step, 0);
|
||||
}
|
||||
/** @var Collection $filtered */
|
||||
/** @var Collection $finalFiltered */
|
||||
$finalFiltered = $set->filter(
|
||||
function (PiggyBankEvent $event) use ($today) {
|
||||
return $event->date->lte($today);
|
||||
}
|
||||
);
|
||||
$finalSum = $filtered->sum('amount');
|
||||
$finalSum = $finalFiltered->sum('amount');
|
||||
$finalLabel = $today->formatLocalized((string)trans('config.month_and_day'));
|
||||
$chartData[$finalLabel] = $finalSum;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user