diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 9eb8056a..9171a9a2 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -12,19 +12,19 @@ // But then we have some exclusions, i.e. we disable some of the checks/rules from Symfony: // Logic - 'yoda_style' => FALSE, // Allow both Yoda-style and regular comparisons. + 'yoda_style' => false, // Allow both Yoda-style and regular comparisons. // Whitespace - 'blank_line_before_statement' => FALSE, // Don't put blank lines before `return` statements. - 'concat_space' => FALSE, // Allow spaces around string concatenation operator. - 'blank_line_after_opening_tag' => FALSE, // Allow file-level @noinspection suppressions to live on the ` FALSE, // Allow `throw` statements to span multiple lines. + 'blank_line_before_statement' => false, // Don't put blank lines before `return` statements. + 'concat_space' => false, // Allow spaces around string concatenation operator. + 'blank_line_after_opening_tag' => false, // Allow file-level @noinspection suppressions to live on the ` false, // Allow `throw` statements to span multiple lines. // phpDoc - 'phpdoc_align' => FALSE, // Don't add spaces within phpDoc just to make parameter names / descriptions align. - 'phpdoc_annotation_without_dot' => FALSE, // Allow terminating dot on @param and such. - 'phpdoc_no_alias_tag' => FALSE, // Allow @link in addition to @see. - 'phpdoc_separation' => FALSE, // Don't put blank line between @params, @throws and @return. - 'phpdoc_summary' => FALSE, // Don't force terminating dot on the first line. + 'phpdoc_align' => false, // Don't add spaces within phpDoc just to make parameter names / descriptions align. + 'phpdoc_annotation_without_dot' => false, // Allow terminating dot on @param and such. + 'phpdoc_no_alias_tag' => false, // Allow @link in addition to @see. + 'phpdoc_separation' => false, // Don't put blank line between @params, @throws and @return. + 'phpdoc_summary' => false, // Don't force terminating dot on the first line. ]) ->setFinder($finder); diff --git a/lib/Fhp/Action/GetBalance.php b/lib/Fhp/Action/GetBalance.php index d0dab2d3..8a09242e 100644 --- a/lib/Fhp/Action/GetBalance.php +++ b/lib/Fhp/Action/GetBalance.php @@ -79,7 +79,7 @@ public function __unserialize(array $serialized): void { list( $parentSerialized, - $this->account, $this->allAccounts + $this->account, $this->allAccounts, ) = $serialized; is_array($parentSerialized) ? diff --git a/lib/Fhp/Action/GetDepotAufstellung.php b/lib/Fhp/Action/GetDepotAufstellung.php index 0dadcda8..e449406b 100644 --- a/lib/Fhp/Action/GetDepotAufstellung.php +++ b/lib/Fhp/Action/GetDepotAufstellung.php @@ -81,7 +81,7 @@ public function __unserialize(array $serialized): void { list( $parentSerialized, - $this->account + $this->account, ) = $serialized; is_array($parentSerialized) ? diff --git a/lib/Fhp/Action/GetStatementOfAccount.php b/lib/Fhp/Action/GetStatementOfAccount.php index a8a7cf89..a581f991 100644 --- a/lib/Fhp/Action/GetStatementOfAccount.php +++ b/lib/Fhp/Action/GetStatementOfAccount.php @@ -114,7 +114,7 @@ public function __unserialize(array $serialized): void list( $parentSerialized, $this->account, $this->from, $this->to, $this->allAccounts, - $this->bankName + $this->bankName, ) = $serialized; is_array($parentSerialized) ? diff --git a/lib/Fhp/Action/GetStatementOfAccountXML.php b/lib/Fhp/Action/GetStatementOfAccountXML.php index 70563edd..4bb31497 100644 --- a/lib/Fhp/Action/GetStatementOfAccountXML.php +++ b/lib/Fhp/Action/GetStatementOfAccountXML.php @@ -98,7 +98,7 @@ public function __unserialize(array $serialized): void { list( $parentSerialized, - $this->account, $this->camtURN, $this->from, $this->to, $this->allAccounts + $this->account, $this->camtURN, $this->from, $this->to, $this->allAccounts, ) = $serialized; is_array($parentSerialized) ? diff --git a/lib/Fhp/Action/SendSEPADirectDebit.php b/lib/Fhp/Action/SendSEPADirectDebit.php index 1c9fe599..c02ab405 100644 --- a/lib/Fhp/Action/SendSEPADirectDebit.php +++ b/lib/Fhp/Action/SendSEPADirectDebit.php @@ -114,7 +114,7 @@ public function __unserialize(array $serialized): void { list( $parentSerialized, - $this->singleDirectDebit, $this->tryToUseControlSumForSingleTransactions, $this->ctrlSum, $this->coreType, $this->painMessage, $this->painNamespace, $this->account + $this->singleDirectDebit, $this->tryToUseControlSumForSingleTransactions, $this->ctrlSum, $this->coreType, $this->painMessage, $this->painNamespace, $this->account, ) = $serialized; is_array($parentSerialized) ? @@ -151,7 +151,7 @@ protected function createRequest(BPD $bpd, ?UPD $upd) // Sometimes the Bank reports supported schemas with a "_GBIC_X" postfix. // GIBC_X stands for German Banking Industry Committee and a version counter. $xmlSchema = $this->painNamespace; - $matchingSchemas = array_filter($supportedPainNamespaces, function($value) use ($xmlSchema) { + $matchingSchemas = array_filter($supportedPainNamespaces, function ($value) use ($xmlSchema) { // For example urn:iso:std:iso:20022:tech:xsd:pain.008.001.08 from the xml matches // urn:iso:std:iso:20022:tech:xsd:pain.008.001.08_GBIC_4 return str_starts_with($value, $xmlSchema); diff --git a/lib/Fhp/Action/SendSEPARealtimeTransfer.php b/lib/Fhp/Action/SendSEPARealtimeTransfer.php index 37a84ecc..712b3bf4 100644 --- a/lib/Fhp/Action/SendSEPARealtimeTransfer.php +++ b/lib/Fhp/Action/SendSEPARealtimeTransfer.php @@ -69,7 +69,7 @@ protected function createRequest(BPD $bpd, ?UPD $upd) // Sometimes the Bank reports supported schemas with a "_GBIC_X" postfix. // GIBC_X stands for German Banking Industry Committee and a version counter. $xmlSchema = $this->xmlSchema; - $matchingSchemas = array_filter($supportedSchemas, function($value) use ($xmlSchema) { + $matchingSchemas = array_filter($supportedSchemas, function ($value) use ($xmlSchema) { // For example urn:iso:std:iso:20022:tech:xsd:pain.001.001.09 from the xml matches // urn:iso:std:iso:20022:tech:xsd:pain.001.001.09_GBIC_4 return str_starts_with($value, $xmlSchema); @@ -104,8 +104,8 @@ public function processResponse(Message $response) return; } - if ($response->findRueckmeldung(Rueckmeldungscode::ENTGEGENGENOMMEN) === null && - $response->findRueckmeldung(Rueckmeldungscode::AUSGEFUEHRT) === null) { + if ($response->findRueckmeldung(Rueckmeldungscode::ENTGEGENGENOMMEN) === null + && $response->findRueckmeldung(Rueckmeldungscode::AUSGEFUEHRT) === null) { throw new UnexpectedResponseException('Bank did not confirm SEPATransfer execution'); } } diff --git a/lib/Fhp/Action/SendSEPATransfer.php b/lib/Fhp/Action/SendSEPATransfer.php index cc2370d7..48cdae9b 100644 --- a/lib/Fhp/Action/SendSEPATransfer.php +++ b/lib/Fhp/Action/SendSEPATransfer.php @@ -46,8 +46,8 @@ public static function create(SEPAAccount $account, string $painMessage): SendSE protected function createRequest(BPD $bpd, ?UPD $upd) { - //ANALYSE XML FOR RECEIPTS AND PAYMENT DATE - $xmlAsObject = simplexml_load_string($this->painMessage, "SimpleXMLElement", LIBXML_NOCDATA); + // ANALYSE XML FOR RECEIPTS AND PAYMENT DATE + $xmlAsObject = simplexml_load_string($this->painMessage, 'SimpleXMLElement', LIBXML_NOCDATA); $numberOfTransactions = $xmlAsObject->CstmrCdtTrfInitn->GrpHdr->NbOfTxs; $hasReqdExDates = false; foreach ($xmlAsObject->CstmrCdtTrfInitn?->PmtInf as $pmtInfo) { @@ -58,25 +58,21 @@ protected function createRequest(BPD $bpd, ?UPD $upd) } } - //NOW READ OUT, WICH SEGMENT SHOULD BE USED: + // NOW READ OUT, WICH SEGMENT SHOULD BE USED: if ($numberOfTransactions > 1 && $hasReqdExDates) { - // Terminierte SEPA-Sammelüberweisung (Segment HKCME / Kennung HICMES) $segmentID = 'HICMES'; $segment = \Fhp\Segment\CME\HKCMEv1::createEmpty(); } elseif ($numberOfTransactions == 1 && $hasReqdExDates) { - // Terminierte SEPA-Überweisung (Segment HKCSE / Kennung HICSES) $segmentID = 'HICSES'; $segment = \Fhp\Segment\CSE\HKCSEv1::createEmpty(); } elseif ($numberOfTransactions > 1 && !$hasReqdExDates) { - // SEPA-Sammelüberweisungen (Segment HKCCM / Kennung HICSES) $segmentID = 'HICSES'; $segment = \Fhp\Segment\CCM\HKCCMv1::createEmpty(); } else { - - //SEPA Einzelüberweisung (Segment HKCCS / Kennung HICCSS). + // SEPA Einzelüberweisung (Segment HKCCS / Kennung HICCSS). $segmentID = 'HICCSS'; $segment = \Fhp\Segment\CCS\HKCCSv1::createEmpty(); } @@ -92,7 +88,7 @@ protected function createRequest(BPD $bpd, ?UPD $upd) // Sometimes the Bank reports supported schemas with a "_GBIC_X" postfix. // GIBC_X stands for German Banking Industry Committee and a version counter. $xmlSchema = $this->xmlSchema; - $matchingSchemas = array_filter($supportedSchemas, function($value) use ($xmlSchema) { + $matchingSchemas = array_filter($supportedSchemas, function ($value) use ($xmlSchema) { // For example urn:iso:std:iso:20022:tech:xsd:pain.001.001.09 from the xml matches // urn:iso:std:iso:20022:tech:xsd:pain.001.001.09_GBIC_4 return str_starts_with($value, $xmlSchema); diff --git a/lib/Fhp/BaseAction.php b/lib/Fhp/BaseAction.php index 76ab7fc3..2335aec0 100644 --- a/lib/Fhp/BaseAction.php +++ b/lib/Fhp/BaseAction.php @@ -106,7 +106,7 @@ public function __unserialize(array $serialized): void list( $this->requestSegmentNumbers, $this->tanRequest, - $this->needTanForSegment + $this->needTanForSegment, ) = $serialized; } diff --git a/lib/Fhp/FinTs.php b/lib/Fhp/FinTs.php index a124c27a..6b5ffe44 100644 --- a/lib/Fhp/FinTs.php +++ b/lib/Fhp/FinTs.php @@ -226,7 +226,7 @@ private function loadPersistedInstanceVersion2(array $data) $this->selectedTanMedium, $this->kundensystemId, $this->dialogId, - $this->messageNumber + $this->messageNumber, ) = $data; } @@ -571,7 +571,7 @@ public function forgetDialog() public function getTanModes(): array { $this->ensureTanModesAvailable(); - $result = array(); + $result = []; foreach ($this->allowedTanModes as $tanModeId) { if (!array_key_exists($tanModeId, $this->bpd->allTanModes)) continue; $result[$tanModeId] = $this->bpd->allTanModes[$tanModeId]; diff --git a/lib/Fhp/MT940/MT940.php b/lib/Fhp/MT940/MT940.php index 32c4b034..9bf24f71 100644 --- a/lib/Fhp/MT940/MT940.php +++ b/lib/Fhp/MT940/MT940.php @@ -142,8 +142,8 @@ public function parse(string $rawData): array $soaDate = $this->getDate(substr($day[$i], 1, 6)); if (isset($result[$soaDate])) { - #$result[$soaDate] = ['end_balance' => []]; - + // $result[$soaDate] = ['end_balance' => []]; + $amount = str_replace(',', '.', substr($day[$i], 10, -1)); $cdMark = substr($day[$i], 0, 1); if ($cdMark == 'C') { diff --git a/lib/Fhp/Model/StatementOfAccount/StatementOfAccount.php b/lib/Fhp/Model/StatementOfAccount/StatementOfAccount.php index 1b5f9bfd..d9e597b7 100644 --- a/lib/Fhp/Model/StatementOfAccount/StatementOfAccount.php +++ b/lib/Fhp/Model/StatementOfAccount/StatementOfAccount.php @@ -75,7 +75,7 @@ public static function fromMT940Array(array $array): StatementOfAccount $statementModel->setStartBalance((float) $statement['start_balance']['amount']); } if (isset($statement['end_balance'])) { - $statementModel->setEndBalance((float) $statement['end_balance']['amount'] * ($statement["end_balance"]['credit_debit'] == MT940::CD_CREDIT ? 1 : -1)); + $statementModel->setEndBalance((float) $statement['end_balance']['amount'] * ($statement['end_balance']['credit_debit'] == MT940::CD_CREDIT ? 1 : -1)); } if (isset($statement['start_balance']['credit_debit'])) { $statementModel->setCreditDebit($statement['start_balance']['credit_debit']); diff --git a/lib/Fhp/Protocol/DialogInitialization.php b/lib/Fhp/Protocol/DialogInitialization.php index 2e1974f5..f31fdf91 100644 --- a/lib/Fhp/Protocol/DialogInitialization.php +++ b/lib/Fhp/Protocol/DialogInitialization.php @@ -143,7 +143,7 @@ public function __unserialize(array $serialized): void $this->hktanRef, $this->kundensystemId, $this->messageNumber, - $this->dialogId + $this->dialogId, ) = $serialized; is_array($parentSerialized) ? diff --git a/lib/Fhp/Protocol/UnexpectedResponseException.php b/lib/Fhp/Protocol/UnexpectedResponseException.php index daea6083..02b183ca 100644 --- a/lib/Fhp/Protocol/UnexpectedResponseException.php +++ b/lib/Fhp/Protocol/UnexpectedResponseException.php @@ -8,7 +8,7 @@ */ class UnexpectedResponseException extends \RuntimeException { - public function __construct(string $message, int $code = 0, \Exception $previous = null) + public function __construct(string $message, int $code = 0, ?\Exception $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/lib/Fhp/Segment/CSE/HKCSEv1.php b/lib/Fhp/Segment/CSE/HKCSEv1.php index 5861cde6..515e3a39 100644 --- a/lib/Fhp/Segment/CSE/HKCSEv1.php +++ b/lib/Fhp/Segment/CSE/HKCSEv1.php @@ -17,7 +17,7 @@ class HKCSEv1 extends BaseSegment public \Fhp\Segment\Common\Kti $kontoverbindungInternational; /** Max length: 256 */ public string $sepaDescriptor; - /** + /** * The PAIN message in XML format. * HISPAS informs which XML schemas are allowed. * The field must be 1999-01-01. diff --git a/lib/Fhp/Segment/CSE/ParameterTerminierteSEPAUeberweisungEinreichenV1.php b/lib/Fhp/Segment/CSE/ParameterTerminierteSEPAUeberweisungEinreichenV1.php index 905aff93..10582238 100644 --- a/lib/Fhp/Segment/CSE/ParameterTerminierteSEPAUeberweisungEinreichenV1.php +++ b/lib/Fhp/Segment/CSE/ParameterTerminierteSEPAUeberweisungEinreichenV1.php @@ -9,5 +9,4 @@ class ParameterTerminierteSEPAUeberweisungEinreichenV1 extends BaseDeg /** Must be => 1 */ public int $minimaleVorlaufzeit; public int $maximaleVorlaufzeit; - } diff --git a/lib/Fhp/Segment/HIUPA/HIUPAv4.php b/lib/Fhp/Segment/HIUPA/HIUPAv4.php index 5dc197fc..5088d3e2 100644 --- a/lib/Fhp/Segment/HIUPA/HIUPAv4.php +++ b/lib/Fhp/Segment/HIUPA/HIUPAv4.php @@ -24,7 +24,6 @@ class HIUPAv4 extends BaseSegment * it does not support it, so sending such a request to the bank will always lead to failure. * 1: Explicitly declared types are definitely supported, anything else may be reported and can be sent; the bank * will check online and accept/reject accordingly. - * @var int */ public int $updVerwendung; /** Max length: 35 */ diff --git a/lib/Fhp/Segment/HKIDN/HKIDNv2.php b/lib/Fhp/Segment/HKIDN/HKIDNv2.php index 155abd2f..f4147de6 100644 --- a/lib/Fhp/Segment/HKIDN/HKIDNv2.php +++ b/lib/Fhp/Segment/HKIDN/HKIDNv2.php @@ -30,7 +30,6 @@ class HKIDNv2 extends BaseSegment * 0: Kundensystem-ID wird nicht benötigt (HBCI DDV-Verfahren und chipkartenbasierte Verfahren ab * Sicherheitsprofil-Version 3) * 1: Kundensystem-ID wird benötigt (sonstige HBCI RAH-/RDH- und PIN/TAN-Verfahren) - * @var int */ public int $kundensystemStatus = 1; // This library only supports PIN/TAN, hence 1 is the right choice. diff --git a/lib/Fhp/Segment/IPZ/HIIPZSv1.php b/lib/Fhp/Segment/IPZ/HIIPZSv1.php index 21b915ab..2f4d7f2c 100644 --- a/lib/Fhp/Segment/IPZ/HIIPZSv1.php +++ b/lib/Fhp/Segment/IPZ/HIIPZSv1.php @@ -11,7 +11,6 @@ * @link https://www.hbci-zka.de/dokumente/spezifikation_deutsch/fintsv3/FinTS_3.0_Messages_Geschaeftsvorfaelle_2022-04-15_final_version.pdf * Section: C.10.2.9.1.1 c) */ - class HIIPZSv1 extends BaseGeschaeftsvorfallparameter { public ParameterSEPAInstantPaymentZahlungV1 $parameter; diff --git a/lib/Fhp/Segment/IPZ/HIIPZSv2.php b/lib/Fhp/Segment/IPZ/HIIPZSv2.php index e78c92ba..b31acf3c 100644 --- a/lib/Fhp/Segment/IPZ/HIIPZSv2.php +++ b/lib/Fhp/Segment/IPZ/HIIPZSv2.php @@ -2,7 +2,6 @@ namespace Fhp\Segment\IPZ; -use Fhp\Segment\IPZ\ParameterSEPAInstantPaymentZahlungV2; use Fhp\Segment\BaseGeschaeftsvorfallparameter; use Fhp\Segment\BaseSegment; @@ -12,7 +11,6 @@ * @link https://www.hbci-zka.de/dokumente/spezifikation_deutsch/fintsv3/FinTS_3.0_Messages_Geschaeftsvorfaelle_2022-04-15_final_version.pdf * Section: C.10.2.9.1.2 c) */ - class HIIPZSv2 extends BaseGeschaeftsvorfallparameter { public ParameterSEPAInstantPaymentZahlungV2 $parameter; diff --git a/lib/Fhp/Segment/IPZ/HKIPZv1.php b/lib/Fhp/Segment/IPZ/HKIPZv1.php index b5ffdf93..9d7dcdd5 100644 --- a/lib/Fhp/Segment/IPZ/HKIPZv1.php +++ b/lib/Fhp/Segment/IPZ/HKIPZv1.php @@ -12,5 +12,4 @@ */ class HKIPZv1 extends HKCCSv1 { - } diff --git a/lib/Fhp/Segment/IPZ/ParameterSEPAInstantPaymentZahlungV1.php b/lib/Fhp/Segment/IPZ/ParameterSEPAInstantPaymentZahlungV1.php index 9ae83ab2..11cf6d68 100644 --- a/lib/Fhp/Segment/IPZ/ParameterSEPAInstantPaymentZahlungV1.php +++ b/lib/Fhp/Segment/IPZ/ParameterSEPAInstantPaymentZahlungV1.php @@ -21,4 +21,4 @@ class ParameterSEPAInstantPaymentZahlungV1 extends BaseDeg implements Unterstuet /** @var string[]|null @Max(9) Max length: 256 */ public ?array $unterstuetzteSEPADatenformate = null; -} \ No newline at end of file +} diff --git a/lib/Fhp/Segment/SPA/ParameterSepaKontoverbindungAnfordern.php b/lib/Fhp/Segment/SPA/ParameterSepaKontoverbindungAnfordern.php index d0b09eb7..27e5f179 100644 --- a/lib/Fhp/Segment/SPA/ParameterSepaKontoverbindungAnfordern.php +++ b/lib/Fhp/Segment/SPA/ParameterSepaKontoverbindungAnfordern.php @@ -10,5 +10,4 @@ */ interface ParameterSepaKontoverbindungAnfordern extends UnterstuetzteSEPADatenformate { - } diff --git a/lib/Fhp/Syntax/InvalidResponseException.php b/lib/Fhp/Syntax/InvalidResponseException.php index c6fe5f8c..f69f75da 100644 --- a/lib/Fhp/Syntax/InvalidResponseException.php +++ b/lib/Fhp/Syntax/InvalidResponseException.php @@ -7,7 +7,7 @@ */ class InvalidResponseException extends \RuntimeException { - public function __construct(string $message, int $code = 0, \Exception $previous = null) + public function __construct(string $message, int $code = 0, ?\Exception $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/lib/Fhp/Syntax/Parser.php b/lib/Fhp/Syntax/Parser.php index 5e730432..72620ac0 100644 --- a/lib/Fhp/Syntax/Parser.php +++ b/lib/Fhp/Syntax/Parser.php @@ -159,8 +159,8 @@ public static function parseBinaryBlock(string $rawValue): ?Bin $delimiterPos = strpos($rawValue, Delimiter::BINARY, 1); if ( - substr($rawValue, 0, 1) !== Delimiter::BINARY || - $delimiterPos === false + substr($rawValue, 0, 1) !== Delimiter::BINARY + || $delimiterPos === false ) { throw new \InvalidArgumentException("Expected binary block header, got $rawValue"); } @@ -205,7 +205,7 @@ public static function parseDeg(string $rawElements, $type, bool $allowEmpty = f * write to (the same instance will be returned from this function). * @param bool $allowEmpty If true, this returns either a valid DEG, or null if *all* the fields were empty. * @param int $offset The position in $rawElements to be read next. - * @return array (BaseDeg|null, integer) + * @return array (BaseDeg|null, int) * 1. The parsed value, which has the given $type or is null in case all the fields were empty and $allowEmpty * is true. * 2. The offset at which parsing should continue. The difference between this returned offset and the $offset diff --git a/lib/Fhp/UnsupportedException.php b/lib/Fhp/UnsupportedException.php index 9c1ca4db..2365ff27 100644 --- a/lib/Fhp/UnsupportedException.php +++ b/lib/Fhp/UnsupportedException.php @@ -7,7 +7,7 @@ */ class UnsupportedException extends \RuntimeException { - public function __construct(string $message, int $code = 0, \Exception $previous = null) + public function __construct(string $message, int $code = 0, ?\Exception $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/lib/Tests/Fhp/Integration/Consors/GetStatementOfAccountTest.php b/lib/Tests/Fhp/Integration/Consors/GetStatementOfAccountTest.php index 466f5545..a492764b 100644 --- a/lib/Tests/Fhp/Integration/Consors/GetStatementOfAccountTest.php +++ b/lib/Tests/Fhp/Integration/Consors/GetStatementOfAccountTest.php @@ -10,15 +10,17 @@ class GetStatementOfAccountTest extends ConsorsIntegrationTestBase public const GET_STATEMENT_REQUEST = "HKKAZ:3:7+DExxABCDEFGH1234567890:CSDBDE71XXX:1234567890::280:50220500+N+20190601+20190922'HKTAN:4:6+4+HKKAZ'"; // Note: Consorsbank weirdly returns November statements even when only up to September was requested. - public const GET_STATEMENT_RESPONSE = "HIRMG:2:2:+3060::Teilweise liegen Warnungen/Hinweise vor.'HIRMS:3:2:3+0020::Der Auftrag wurde ausgefuhrt.+3076::Keine starke Authentifizierung erforderlich.+3997::Der Auftrag wurde nur teilweise ausgefuhrt.'" - . "HIKAZ:4:7:3+@1034@\r\n" - . ":20:0\r\n:21:NONREF\r\n:25:50220500/123456789\r\n:28C:0/7\r\n:60M:C191118EUR950,59\r\n" - . ":61:1911181118D2,8N008NONREF\r\n:86:008?00Dauerauftrag?20EREF+NOTPROVIDED ?21 ?\r\n22KREF+NONREF?23SVWZ+XY?30BICBICBICBI?31DExx444444444444444444?32\r\nMax Mustermannig\r\n:62M:C191118EUR947,79\r\n-\r\n" - . ":20:0\r\n:21:NONREF\r\n:25:50220500/123456789\r\n:28C:0/8\r\n:60M:C191120EUR947,79\r\n" - . ":61:1911201120D11,3N005NONREF\r\n:86:005?00Lastschrift (Einzugsermächtigung)?20EREF+ZAA0987654321 \r\n ?21 ?22KREF+NONREF?23SVWZ+LogPay OnlineTicket i.?\r\n24A.v. Irgendeine Firma und S?25oehne AG. Ihre Kundenn r. 2?26019\r\n999999999?30BICBICBI?31DExx555555555555555555?32LOGPAY FINANCIAL \r\nSERVICES G?33MBH\r\n" - . ":61:1911201120D15,5N005NONREF\r\n:86:005?00Lastschrift (Einzugsermächtigung)?20EREF+ZAA0123456789 \r\n ?21 ?22KREF+NONREF?23SVWZ+LogPay OnlineTicket i.?\r\n24A.v. Irgendeine Firma und S?25oehne AG. Ihre Kundenn r. 2?26019\r\n999999999?30BICBICBI?31DExx555555555555555555?32LOGPAY FINANCIAL \r\nSERVICES G?33MBH\r\n" - . ":62F:C191120EUR920,99\r\n-'" - . "HITAN:5:6:4+4++noref+nochallenge'"; + public const GET_STATEMENT_RESPONSE = ( + "HIRMG:2:2:+3060::Teilweise liegen Warnungen/Hinweise vor.'HIRMS:3:2:3+0020::Der Auftrag wurde ausgefuhrt.+3076::Keine starke Authentifizierung erforderlich.+3997::Der Auftrag wurde nur teilweise ausgefuhrt.'" + . "HIKAZ:4:7:3+@1034@\r\n" + . ":20:0\r\n:21:NONREF\r\n:25:50220500/123456789\r\n:28C:0/7\r\n:60M:C191118EUR950,59\r\n" + . ":61:1911181118D2,8N008NONREF\r\n:86:008?00Dauerauftrag?20EREF+NOTPROVIDED ?21 ?\r\n22KREF+NONREF?23SVWZ+XY?30BICBICBICBI?31DExx444444444444444444?32\r\nMax Mustermannig\r\n:62M:C191118EUR947,79\r\n-\r\n" + . ":20:0\r\n:21:NONREF\r\n:25:50220500/123456789\r\n:28C:0/8\r\n:60M:C191120EUR947,79\r\n" + . ":61:1911201120D11,3N005NONREF\r\n:86:005?00Lastschrift (Einzugsermächtigung)?20EREF+ZAA0987654321 \r\n ?21 ?22KREF+NONREF?23SVWZ+LogPay OnlineTicket i.?\r\n24A.v. Irgendeine Firma und S?25oehne AG. Ihre Kundenn r. 2?26019\r\n999999999?30BICBICBI?31DExx555555555555555555?32LOGPAY FINANCIAL \r\nSERVICES G?33MBH\r\n" + . ":61:1911201120D15,5N005NONREF\r\n:86:005?00Lastschrift (Einzugsermächtigung)?20EREF+ZAA0123456789 \r\n ?21 ?22KREF+NONREF?23SVWZ+LogPay OnlineTicket i.?\r\n24A.v. Irgendeine Firma und S?25oehne AG. Ihre Kundenn r. 2?26019\r\n999999999?30BICBICBI?31DExx555555555555555555?32LOGPAY FINANCIAL \r\nSERVICES G?33MBH\r\n" + . ":62F:C191120EUR920,99\r\n-'" + . "HITAN:5:6:4+4++noref+nochallenge'" + ); // Note: There is no HIKAZ at all in this response, but it's still valid. public const GET_STATEMENT_EMPTY_RESPONSE = "HIRMG:2:2:+3060::Teilweise liegen Warnungen/Hinweise vor.'HIRMS:3:2:3+3010::Keine Umsatze gefunden+3076::Keine starke Authentifizierung erforderlich.'HITAN:4:6:4+4++noref+nochallenge'"; diff --git a/lib/Tests/Fhp/Segment/HICAZTest.php b/lib/Tests/Fhp/Segment/HICAZTest.php index 77ecf675..54e61d9c 100644 --- a/lib/Tests/Fhp/Segment/HICAZTest.php +++ b/lib/Tests/Fhp/Segment/HICAZTest.php @@ -13,59 +13,69 @@ class HICAZTest extends \PHPUnit\Framework\TestCase // Inside segemnts several XMLs can be present, seperated by ":" private const HICAZ_TEST_START = 'HICAZ:5:1:3+DE06940594210000027227:TESTDETT421:::280:+urn?:iso?:std?:iso?:20022?:tech?:xsd?:camt.052.001.02+'; - private const SAMPLE_XML_DOC1 = '' . - '' . - 'camt52_20131118101510__ONLINEBA' . - '2013-11-18T10:15:10+01:001true' . - 'camt052_ONLINEBA' . - 'BOOK' . - 'BOOK' . - ''; - private const SAMPLE_XML_DOC2 = '' . - '' . - 'camt52_20131118101510__ONLINEBA' . - '2013-11-18T10:15:10+01:001true' . - 'camt052_ONLINEBA' . - 'BOOK' . - 'BOOK' . - 'BOOK' . - 'BOOK' . - ''; - private const SAMPLE_XML_DOC3 = '' . - '' . - 'camt52_20131118101510__ONLINEBA' . - '2013-11-18T10:15:10+01:001true' . - 'camt052_ONLINEBA' . - 'PDNG' . - ''; + private const SAMPLE_XML_DOC1 = ( + '' . + '' . + 'camt52_20131118101510__ONLINEBA' . + '2013-11-18T10:15:10+01:001true' . + 'camt052_ONLINEBA' . + 'BOOK' . + 'BOOK' . + '' + ); + private const SAMPLE_XML_DOC2 = ( + '' . + '' . + 'camt52_20131118101510__ONLINEBA' . + '2013-11-18T10:15:10+01:001true' . + 'camt052_ONLINEBA' . + 'BOOK' . + 'BOOK' . + 'BOOK' . + 'BOOK' . + '' + ); + private const SAMPLE_XML_DOC3 = ( + '' . + '' . + 'camt52_20131118101510__ONLINEBA' . + '2013-11-18T10:15:10+01:001true' . + 'camt052_ONLINEBA' . + 'PDNG' . + '' + ); public function testHICAZparse() { // First example: two XMLs seperated by ":" - both are gebuchteUmsaetze - $hicaz1 = HICAZv1::parse(static::HICAZ_TEST_START . - '@' . strlen(static::SAMPLE_XML_DOC1) . '@' . - static::SAMPLE_XML_DOC1 . - ':' . - '@' . strlen(static::SAMPLE_XML_DOC2) . '@' . - static::SAMPLE_XML_DOC2 . - "'"); + $hicaz1 = HICAZv1::parse( + static::HICAZ_TEST_START . + '@' . strlen(static::SAMPLE_XML_DOC1) . '@' . + static::SAMPLE_XML_DOC1 . + ':' . + '@' . strlen(static::SAMPLE_XML_DOC2) . '@' . + static::SAMPLE_XML_DOC2 . + "'" + ); $this->assertEquals([static::SAMPLE_XML_DOC1, static::SAMPLE_XML_DOC2], $hicaz1->getGebuchteUmsaetze()); // Second example: two areas seperated by +, first area has a group of two XMLs seperated by : - $hicaz2 = HICAZv1::parse(static::HICAZ_TEST_START . - '@' . strlen(static::SAMPLE_XML_DOC1) . '@' . - static::SAMPLE_XML_DOC1 . - ':@' . strlen(static::SAMPLE_XML_DOC2) . '@' . - static::SAMPLE_XML_DOC2 . - '+@' . strlen(static::SAMPLE_XML_DOC3) . '@' . - static::SAMPLE_XML_DOC3 . - "'"); + $hicaz2 = HICAZv1::parse( + static::HICAZ_TEST_START . + '@' . strlen(static::SAMPLE_XML_DOC1) . '@' . + static::SAMPLE_XML_DOC1 . + ':@' . strlen(static::SAMPLE_XML_DOC2) . '@' . + static::SAMPLE_XML_DOC2 . + '+@' . strlen(static::SAMPLE_XML_DOC3) . '@' . + static::SAMPLE_XML_DOC3 . + "'" + ); $this->assertEquals([static::SAMPLE_XML_DOC1, static::SAMPLE_XML_DOC2], $hicaz2->getGebuchteUmsaetze()); $this->assertEquals(static::SAMPLE_XML_DOC3, diff --git a/lib/Tests/Fhp/Unit/SendSEPADirectDebitTest.php b/lib/Tests/Fhp/Unit/SendSEPADirectDebitTest.php index 96d7d827..f92c4a84 100644 --- a/lib/Tests/Fhp/Unit/SendSEPADirectDebitTest.php +++ b/lib/Tests/Fhp/Unit/SendSEPADirectDebitTest.php @@ -2,7 +2,6 @@ namespace Tests\Fhp\Unit; - use Fhp\Action\SendSEPADirectDebit; use Fhp\Model\SEPAAccount; use Tests\Fhp\FinTsTestCase;