mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Small code improvements.
This commit is contained in:
parent
f74a6dffca
commit
b33883b334
@ -139,17 +139,17 @@ class HaveAccounts implements ConfigurationInterface
|
|||||||
*/
|
*/
|
||||||
private function filterAccounts(array $dbAccounts, string $code): array
|
private function filterAccounts(array $dbAccounts, string $code): array
|
||||||
{
|
{
|
||||||
$account = [];
|
$accounts = [];
|
||||||
foreach ($dbAccounts as $accountId => $data) {
|
foreach ($dbAccounts as $accountId => $data) {
|
||||||
if ($data['currency']->code === $code) {
|
if ($data['currency']->code === $code) {
|
||||||
$account[$accountId] = [
|
$accounts[$accountId] = [
|
||||||
'name' => $data['account']['name'],
|
'name' => $data['account']['name'],
|
||||||
'iban' => $data['account']['iban'],
|
'iban' => $data['account']['iban'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $account;
|
return $accounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -157,16 +157,17 @@ class HaveAccounts implements ConfigurationInterface
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function getIban(array $bunqAccount)
|
private function getIban(array $bunqAccount): string
|
||||||
{
|
{
|
||||||
$iban = '';
|
$iban = '';
|
||||||
if (count($bunqAccount['alias'])) {
|
if (\is_array($bunqAccount['alias'])) {
|
||||||
foreach ($bunqAccount['alias'] as $alias) {
|
foreach ($bunqAccount['alias'] as $alias) {
|
||||||
if ($alias['type'] === 'IBAN') {
|
if ($alias['type'] === 'IBAN') {
|
||||||
$iban = $alias['value'];
|
$iban = $alias['value'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $iban;
|
return $iban;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user