mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Reformat various code.
This commit is contained in:
@@ -114,8 +114,8 @@ class FrontpageChartGenerator
|
||||
$tempData[] = [
|
||||
'name' => $category->name,
|
||||
'sum' => $currency['sum'],
|
||||
'sum_float' => round((float)$currency['sum'], $currency['currency_decimal_places']),
|
||||
'currency_id' => (int)$currency['currency_id'],
|
||||
'sum_float' => round((float) $currency['sum'], $currency['currency_decimal_places']),
|
||||
'currency_id' => (int) $currency['currency_id'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ class FrontpageChartGenerator
|
||||
*/
|
||||
private function addCurrency(array $currency): void
|
||||
{
|
||||
$currencyId = (int)$currency['currency_id'];
|
||||
$currencyId = (int) $currency['currency_id'];
|
||||
|
||||
$this->currencies[$currencyId] = $this->currencies[$currencyId] ?? [
|
||||
'currency_id' => $currencyId,
|
||||
@@ -152,8 +152,8 @@ class FrontpageChartGenerator
|
||||
$tempData[] = [
|
||||
'name' => trans('firefly.no_category'),
|
||||
'sum' => $currency['sum'],
|
||||
'sum_float' => round((float)$currency['sum'], $currency['currency_decimal_places'] ?? 2),
|
||||
'currency_id' => (int)$currency['currency_id'],
|
||||
'sum_float' => round((float) $currency['sum'], $currency['currency_decimal_places'] ?? 2),
|
||||
'currency_id' => (int) $currency['currency_id'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ class FrontpageChartGenerator
|
||||
foreach ($this->currencies as $currencyId => $currency) {
|
||||
$key = sprintf('spent-%d', $currencyId);
|
||||
$return[$key] = [
|
||||
'label' => sprintf('%s (%s)', (string)trans('firefly.spent'), $currency['currency_name']),
|
||||
'label' => sprintf('%s (%s)', (string) trans('firefly.spent'), $currency['currency_name']),
|
||||
'type' => 'bar',
|
||||
'currency_symbol' => $currency['currency_symbol'],
|
||||
'entries' => $names,
|
||||
|
@@ -77,14 +77,14 @@ class WholePeriodChartGenerator
|
||||
$code = $currency['currency_code'];
|
||||
$name = $currency['currency_name'];
|
||||
$chartData[sprintf('spent-in-%s', $code)] = [
|
||||
'label' => (string)trans('firefly.box_spent_in_currency', ['currency' => $name]),
|
||||
'label' => (string) trans('firefly.box_spent_in_currency', ['currency' => $name]),
|
||||
'entries' => [],
|
||||
'type' => 'bar',
|
||||
'backgroundColor' => 'rgba(219, 68, 55, 0.5)', // red
|
||||
];
|
||||
|
||||
$chartData[sprintf('earned-in-%s', $code)] = [
|
||||
'label' => (string)trans('firefly.box_earned_in_currency', ['currency' => $name]),
|
||||
'label' => (string) trans('firefly.box_earned_in_currency', ['currency' => $name]),
|
||||
'entries' => [],
|
||||
'type' => 'bar',
|
||||
'backgroundColor' => 'rgba(0, 141, 76, 0.5)', // green
|
||||
@@ -105,8 +105,8 @@ class WholePeriodChartGenerator
|
||||
$earnedInfoKey = sprintf('earned-in-%s', $code);
|
||||
$spentAmount = $spent[$key][$currencyId]['sum'] ?? '0';
|
||||
$earnedAmount = $earned[$key][$currencyId]['sum'] ?? '0';
|
||||
$chartData[$spentInfoKey]['entries'][$label] = round((float)$spentAmount, $currency['currency_decimal_places']);
|
||||
$chartData[$earnedInfoKey]['entries'][$label] = round((float)$earnedAmount, $currency['currency_decimal_places']);
|
||||
$chartData[$spentInfoKey]['entries'][$label] = round((float) $spentAmount, $currency['currency_decimal_places']);
|
||||
$chartData[$earnedInfoKey]['entries'][$label] = round((float) $earnedAmount, $currency['currency_decimal_places']);
|
||||
}
|
||||
$current = app('navigation')->addPeriod($current, $step, 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user