From 6447b887f068e1b5db568e94e5f14b5c819a8dd3 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 26 Dec 2023 10:24:42 +1100 Subject: [PATCH] Static Analysis --- app/Helpers/Bank/Nordigen/Nordigen.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/app/Helpers/Bank/Nordigen/Nordigen.php b/app/Helpers/Bank/Nordigen/Nordigen.php index 24bc0dc58a..9ed080407c 100644 --- a/app/Helpers/Bank/Nordigen/Nordigen.php +++ b/app/Helpers/Bank/Nordigen/Nordigen.php @@ -85,6 +85,7 @@ class Nordigen $it = new AccountTransformer(); return $it->transform($out); + } catch (\Exception $e) { if (strpos($e->getMessage(), "Invalid Account ID") !== false) return false; @@ -92,8 +93,14 @@ class Nordigen throw $e; } } - - public function isAccountActive(string $account_id) + + /** + * isAccountActive + * + * @param string $account_id + * @return bool + */ + public function isAccountActive(string $account_id): bool { try { $account = $this->client->account($account_id)->getAccountMetaData(); @@ -112,11 +119,15 @@ class Nordigen } } + /** - * this method returns booked transactions from the bank_account, pending transactions are not part of the result - * @todo @turbo124 should we include pending transactions within the integration-process and mark them with a specific category?! + * getTransactions + * + * @param string $accountId + * @param string $dateFrom + * @return array */ - public function getTransactions(string $accountId, string $dateFrom = null) + public function getTransactions(string $accountId, string $dateFrom = null): array { $transactionResponse = $this->client->account($accountId)->getAccountTransactions($dateFrom);