mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Various code cleanup and fixed alignments.
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
$current = __DIR__;
|
$current = __DIR__;
|
||||||
|
|
||||||
$paths = [
|
$paths = [
|
||||||
$current . '/../../app/Api/V1/Controllers/Autocomplete',
|
$current . '/../../app/Api/V1',
|
||||||
// $current . '/../../config',
|
// $current . '/../../config',
|
||||||
// $current . '/../../database',
|
// $current . '/../../database',
|
||||||
// $current . '/../../routes',
|
// $current . '/../../routes',
|
||||||
@@ -61,7 +61,8 @@ return $config->setRules([
|
|||||||
'default' => 'at_least_single_space',
|
'default' => 'at_least_single_space',
|
||||||
'operators' => [
|
'operators' => [
|
||||||
'=>' => 'align_single_space_by_scope',
|
'=>' => 'align_single_space_by_scope',
|
||||||
'=' => 'align_single_space_minimal',
|
'=' => 'align_single_space_minimal_by_scope',
|
||||||
|
'??=' => 'align_single_space_minimal_by_scope',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'void_return' => true,
|
'void_return' => true,
|
||||||
|
@@ -75,28 +75,28 @@ class TagController extends Controller
|
|||||||
$genericSet = $collector->getExtractedJournals();
|
$genericSet = $collector->getExtractedJournals();
|
||||||
|
|
||||||
foreach ($genericSet as $journal) {
|
foreach ($genericSet as $journal) {
|
||||||
$currencyId = (int)$journal['currency_id'];
|
$currencyId = (int) $journal['currency_id'];
|
||||||
$foreignCurrencyId = (int)$journal['foreign_currency_id'];
|
$foreignCurrencyId = (int) $journal['foreign_currency_id'];
|
||||||
|
|
||||||
if (0 !== $currencyId) {
|
if (0 !== $currencyId) {
|
||||||
$response[$currencyId] ??= [
|
$response[$currencyId] ??= [
|
||||||
'difference' => '0',
|
'difference' => '0',
|
||||||
'difference_float' => 0,
|
'difference_float' => 0,
|
||||||
'currency_id' => (string)$currencyId,
|
'currency_id' => (string) $currencyId,
|
||||||
'currency_code' => $journal['currency_code'],
|
'currency_code' => $journal['currency_code'],
|
||||||
];
|
];
|
||||||
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], $journal['amount']);
|
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], $journal['amount']);
|
||||||
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference']; // float but on purpose.
|
$response[$currencyId]['difference_float'] = (float) $response[$currencyId]['difference']; // float but on purpose.
|
||||||
}
|
}
|
||||||
if (0 !== $foreignCurrencyId) {
|
if (0 !== $foreignCurrencyId) {
|
||||||
$response[$foreignCurrencyId] ??= [
|
$response[$foreignCurrencyId] ??= [
|
||||||
'difference' => '0',
|
'difference' => '0',
|
||||||
'difference_float' => 0,
|
'difference_float' => 0,
|
||||||
'currency_id' => (string)$foreignCurrencyId,
|
'currency_id' => (string) $foreignCurrencyId,
|
||||||
'currency_code' => $journal['foreign_currency_code'],
|
'currency_code' => $journal['foreign_currency_code'],
|
||||||
];
|
];
|
||||||
$response[$foreignCurrencyId]['difference'] = bcadd($response[$foreignCurrencyId]['difference'], $journal['foreign_amount']);
|
$response[$foreignCurrencyId]['difference'] = bcadd($response[$foreignCurrencyId]['difference'], $journal['foreign_amount']);
|
||||||
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference']; // float but on purpose.
|
$response[$foreignCurrencyId]['difference_float'] = (float) $response[$foreignCurrencyId]['difference']; // float but on purpose.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,8 +130,8 @@ class TagController extends Controller
|
|||||||
|
|
||||||
/** @var array $journal */
|
/** @var array $journal */
|
||||||
foreach ($genericSet as $journal) {
|
foreach ($genericSet as $journal) {
|
||||||
$currencyId = (int)$journal['currency_id'];
|
$currencyId = (int) $journal['currency_id'];
|
||||||
$foreignCurrencyId = (int)$journal['foreign_currency_id'];
|
$foreignCurrencyId = (int) $journal['foreign_currency_id'];
|
||||||
|
|
||||||
/** @var array $tag */
|
/** @var array $tag */
|
||||||
foreach ($journal['tags'] as $tag) {
|
foreach ($journal['tags'] as $tag) {
|
||||||
@@ -142,15 +142,15 @@ class TagController extends Controller
|
|||||||
// on currency ID
|
// on currency ID
|
||||||
if (0 !== $currencyId) {
|
if (0 !== $currencyId) {
|
||||||
$response[$key] ??= [
|
$response[$key] ??= [
|
||||||
'id' => (string)$tagId,
|
'id' => (string) $tagId,
|
||||||
'name' => $tag['name'],
|
'name' => $tag['name'],
|
||||||
'difference' => '0',
|
'difference' => '0',
|
||||||
'difference_float' => 0,
|
'difference_float' => 0,
|
||||||
'currency_id' => (string)$currencyId,
|
'currency_id' => (string) $currencyId,
|
||||||
'currency_code' => $journal['currency_code'],
|
'currency_code' => $journal['currency_code'],
|
||||||
];
|
];
|
||||||
$response[$key]['difference'] = bcadd($response[$key]['difference'], $journal['amount']);
|
$response[$key]['difference'] = bcadd($response[$key]['difference'], $journal['amount']);
|
||||||
$response[$key]['difference_float'] = (float)$response[$key]['difference']; // float but on purpose.
|
$response[$key]['difference_float'] = (float) $response[$key]['difference']; // float but on purpose.
|
||||||
}
|
}
|
||||||
|
|
||||||
// on foreign ID
|
// on foreign ID
|
||||||
@@ -158,11 +158,11 @@ class TagController extends Controller
|
|||||||
$response[$foreignKey] = $journal[$foreignKey] ?? [
|
$response[$foreignKey] = $journal[$foreignKey] ?? [
|
||||||
'difference' => '0',
|
'difference' => '0',
|
||||||
'difference_float' => 0,
|
'difference_float' => 0,
|
||||||
'currency_id' => (string)$foreignCurrencyId,
|
'currency_id' => (string) $foreignCurrencyId,
|
||||||
'currency_code' => $journal['foreign_currency_code'],
|
'currency_code' => $journal['foreign_currency_code'],
|
||||||
];
|
];
|
||||||
$response[$foreignKey]['difference'] = bcadd($response[$foreignKey]['difference'], $journal['foreign_amount']);
|
$response[$foreignKey]['difference'] = bcadd($response[$foreignKey]['difference'], $journal['foreign_amount']);
|
||||||
$response[$foreignKey]['difference_float'] = (float)$response[$foreignKey]['difference']; // float but on purpose.
|
$response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference']; // float but on purpose.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user