mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 16:40:10 +00:00
chore: code cleanup.
This commit is contained in:
@@ -139,6 +139,36 @@ class ShowController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $group
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function getAccounts(array $group): array
|
||||
{
|
||||
$accounts = [];
|
||||
|
||||
foreach ($group['transactions'] as $transaction) {
|
||||
$accounts['source'][] = [
|
||||
'type' => $transaction['source_type'],
|
||||
'id' => $transaction['source_id'],
|
||||
'name' => $transaction['source_name'],
|
||||
'iban' => $transaction['source_iban'],
|
||||
];
|
||||
$accounts['destination'][] = [
|
||||
'type' => $transaction['destination_type'],
|
||||
'id' => $transaction['destination_id'],
|
||||
'name' => $transaction['destination_name'],
|
||||
'iban' => $transaction['destination_iban'],
|
||||
];
|
||||
}
|
||||
|
||||
$accounts['source'] = array_unique($accounts['source'], SORT_REGULAR);
|
||||
$accounts['destination'] = array_unique($accounts['destination'], SORT_REGULAR);
|
||||
|
||||
return $accounts;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $group
|
||||
*
|
||||
@@ -173,34 +203,4 @@ class ShowController extends Controller
|
||||
|
||||
return $amounts;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $group
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function getAccounts(array $group): array
|
||||
{
|
||||
$accounts = [];
|
||||
|
||||
foreach ($group['transactions'] as $transaction) {
|
||||
$accounts['source'][] = [
|
||||
'type' => $transaction['source_type'],
|
||||
'id' => $transaction['source_id'],
|
||||
'name' => $transaction['source_name'],
|
||||
'iban' => $transaction['source_iban'],
|
||||
];
|
||||
$accounts['destination'][] = [
|
||||
'type' => $transaction['destination_type'],
|
||||
'id' => $transaction['destination_id'],
|
||||
'name' => $transaction['destination_name'],
|
||||
'iban' => $transaction['destination_iban'],
|
||||
];
|
||||
}
|
||||
|
||||
$accounts['source'] = array_unique($accounts['source'], SORT_REGULAR);
|
||||
$accounts['destination'] = array_unique($accounts['destination'], SORT_REGULAR);
|
||||
|
||||
return $accounts;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user