Small code improvements.

This commit is contained in:
James Cole 2018-04-29 18:07:23 +02:00
parent f74a6dffca
commit b33883b334
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -139,17 +139,17 @@ class HaveAccounts implements ConfigurationInterface
*/
private function filterAccounts(array $dbAccounts, string $code): array
{
$account = [];
$accounts = [];
foreach ($dbAccounts as $accountId => $data) {
if ($data['currency']->code === $code) {
$account[$accountId] = [
$accounts[$accountId] = [
'name' => $data['account']['name'],
'iban' => $data['account']['iban'],
];
}
}
return $account;
return $accounts;
}
/**
@ -157,16 +157,17 @@ class HaveAccounts implements ConfigurationInterface
*
* @return string
*/
private function getIban(array $bunqAccount)
private function getIban(array $bunqAccount): string
{
$iban = '';
if (count($bunqAccount['alias'])) {
if (\is_array($bunqAccount['alias'])) {
foreach ($bunqAccount['alias'] as $alias) {
if ($alias['type'] === 'IBAN') {
$iban = $alias['value'];
}
}
}
return $iban;
}
}