mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
More PHP8.4 updates
This commit is contained in:
@@ -110,7 +110,7 @@ trait AugumentData
|
||||
$grouped = $accounts->groupBy('id')->toArray();
|
||||
$return = [];
|
||||
foreach ($accountIds as $combinedId) {
|
||||
$parts = explode('-', $combinedId);
|
||||
$parts = explode('-', (string) $combinedId);
|
||||
$accountId = (int) $parts[0];
|
||||
if (array_key_exists($accountId, $grouped)) {
|
||||
$return[$accountId] = $grouped[$accountId][0]['name'];
|
||||
@@ -152,7 +152,7 @@ trait AugumentData
|
||||
$grouped = $categories->groupBy('id')->toArray();
|
||||
$return = [];
|
||||
foreach ($categoryIds as $combinedId) {
|
||||
$parts = explode('-', $combinedId);
|
||||
$parts = explode('-', (string) $combinedId);
|
||||
$categoryId = (int) $parts[0];
|
||||
if (array_key_exists($categoryId, $grouped)) {
|
||||
$return[$categoryId] = $grouped[$categoryId][0]['name'];
|
||||
@@ -249,7 +249,7 @@ trait AugumentData
|
||||
}
|
||||
|
||||
$grouped[$name] ??= '0';
|
||||
$grouped[$name] = bcadd($journal['amount'], $grouped[$name]);
|
||||
$grouped[$name] = bcadd((string) $journal['amount'], $grouped[$name]);
|
||||
}
|
||||
|
||||
return $grouped;
|
||||
@@ -287,8 +287,8 @@ trait AugumentData
|
||||
}
|
||||
|
||||
// add amount
|
||||
$sum['per_currency'][$currencyId]['sum'] = bcadd($sum['per_currency'][$currencyId]['sum'], $journal['amount']);
|
||||
$sum['grand_sum'] = bcadd($sum['grand_sum'], $journal['amount']);
|
||||
$sum['per_currency'][$currencyId]['sum'] = bcadd($sum['per_currency'][$currencyId]['sum'], (string) $journal['amount']);
|
||||
$sum['grand_sum'] = bcadd($sum['grand_sum'], (string) $journal['amount']);
|
||||
}
|
||||
|
||||
return $sum;
|
||||
|
@@ -135,11 +135,11 @@ trait PeriodOverview
|
||||
foreach ($transactions as $index => $item) {
|
||||
$date = Carbon::parse($item['date']);
|
||||
if ($date >= $start && $date <= $end) {
|
||||
if ('away' === $direction && -1 === bccomp($item['amount'], '0')) {
|
||||
if ('away' === $direction && -1 === bccomp((string) $item['amount'], '0')) {
|
||||
$result[] = $item;
|
||||
unset($transactions[$index]);
|
||||
}
|
||||
if ('in' === $direction && 1 === bccomp($item['amount'], '0')) {
|
||||
if ('in' === $direction && 1 === bccomp((string) $item['amount'], '0')) {
|
||||
$result[] = $item;
|
||||
unset($transactions[$index]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user