From b33883b33480fecbb71a6e986d8cabd59366912e Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 29 Apr 2018 18:07:23 +0200 Subject: [PATCH] Small code improvements. --- .../Import/Configuration/Bunq/HaveAccounts.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/Support/Import/Configuration/Bunq/HaveAccounts.php b/app/Support/Import/Configuration/Bunq/HaveAccounts.php index cf69af821f..35ec5eae55 100644 --- a/app/Support/Import/Configuration/Bunq/HaveAccounts.php +++ b/app/Support/Import/Configuration/Bunq/HaveAccounts.php @@ -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; } }