From ab2244509ab3588c00752302207c0adfad064492 Mon Sep 17 00:00:00 2001 From: Robert Becker Date: Wed, 26 Nov 2025 10:07:29 +0100 Subject: [PATCH 1/2] Add kontonummer to HIUPDv6 if IBAN is not available --- .gitignore | 1 + lib/Fhp/Segment/HIUPD/HIUPDv6.php | 4 +++- lib/Fhp/Syntax/Serializer.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 60628f8f..ebd1a7a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store .idea/ +.vscode/ vendor/ develop/ coverage/ diff --git a/lib/Fhp/Segment/HIUPD/HIUPDv6.php b/lib/Fhp/Segment/HIUPD/HIUPDv6.php index 710eae49..ddcfb1cb 100644 --- a/lib/Fhp/Segment/HIUPD/HIUPDv6.php +++ b/lib/Fhp/Segment/HIUPD/HIUPDv6.php @@ -53,7 +53,9 @@ class HIUPDv6 extends BaseSegment implements HIUPD public function matchesAccount(SEPAAccount $account): bool { - return !is_null($this->iban) && $this->iban == $account->getIban(); + if (!is_null($this->iban)) return $this->iban == $account->getIban(); + // Sparkasse (Koblenz) does not provide an IBAN in this segment, fall back to kontonummer: + return !is_null($this->kontoverbindung->kontonummer) && $this->kontoverbindung->kontonummer == $account->getAccountNumber(); } public function getErlaubteGeschaeftsvorfaelle(): array diff --git a/lib/Fhp/Syntax/Serializer.php b/lib/Fhp/Syntax/Serializer.php index 155263c9..c0d64ff3 100644 --- a/lib/Fhp/Syntax/Serializer.php +++ b/lib/Fhp/Syntax/Serializer.php @@ -77,7 +77,7 @@ public static function serializeSegment(BaseSegment $segment): string */ public static function serializeSegments(array $segments): string { - return implode(array_map(['self', 'serializeSegment'], $segments)); + return implode(array_map([self::class, 'serializeSegment'], $segments)); } /** From 27e0dacbccd14be340d3f5352f015000c3b3042f Mon Sep 17 00:00:00 2001 From: Robert Becker Date: Wed, 26 Nov 2025 10:17:20 +0100 Subject: [PATCH 2/2] Fix code style conformity --- lib/Fhp/Segment/HIUPD/HIUPDv6.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Fhp/Segment/HIUPD/HIUPDv6.php b/lib/Fhp/Segment/HIUPD/HIUPDv6.php index ddcfb1cb..3ecd9d6f 100644 --- a/lib/Fhp/Segment/HIUPD/HIUPDv6.php +++ b/lib/Fhp/Segment/HIUPD/HIUPDv6.php @@ -53,7 +53,9 @@ class HIUPDv6 extends BaseSegment implements HIUPD public function matchesAccount(SEPAAccount $account): bool { - if (!is_null($this->iban)) return $this->iban == $account->getIban(); + if (!is_null($this->iban)) { + return $this->iban == $account->getIban(); + } // Sparkasse (Koblenz) does not provide an IBAN in this segment, fall back to kontonummer: return !is_null($this->kontoverbindung->kontonummer) && $this->kontoverbindung->kontonummer == $account->getAccountNumber(); }