Fix round() calls for PHP 8.0

This commit is contained in:
James Cole
2020-12-21 09:02:24 +01:00
parent fe66bb1984
commit 670bf26510
10 changed files with 18 additions and 18 deletions

View File

@@ -491,13 +491,13 @@ class BudgetController extends Controller
// get budget limit in this period for this currency.
$limit = $this->blRepository->find($budget, $currency, $currentStart, $currentEnd);
if (null !== $limit) {
$chartData[1]['entries'][$title] = round($limit->amount, $currency->decimal_places);
$chartData[1]['entries'][$title] = round((float) $limit->amount, $currency->decimal_places);
}
// get spent amount in this period for this currency.
$sum = $this->opsRepository->sumExpenses($currentStart, $currentEnd, $accounts, new Collection([$budget]), $currency);
$amount = app('steam')->positive($sum[$currency->id]['sum'] ?? '0');
$chartData[0]['entries'][$title] = round($amount, $currency->decimal_places);
$chartData[0]['entries'][$title] = round((float) $amount, $currency->decimal_places);
$currentStart = clone $currentEnd;
$currentStart->addDay()->startOfDay();
@@ -543,7 +543,7 @@ class BudgetController extends Controller
$title = $currentStart->formatLocalized($titleFormat);
$sum = $this->nbRepository->sumExpenses($currentStart, $currentEnd, $accounts, $currency);
$amount = app('steam')->positive($sum[$currency->id]['sum'] ?? '0');
$chartData[$title] = round($amount, $currency->decimal_places);
$chartData[$title] = round((float) $amount, $currency->decimal_places);
$currentStart = app('navigation')->addPeriod($currentStart, $preferredRange, 0);
}