Skip to content

Commit 8ea287b

Browse files
committed
Fix typo in ultmtCdtr.
This was `ultmtCdrt` before. This key is now deprecated, but still works for backward compatibility. Closes #5.
1 parent fb7b353 commit 8ea287b

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Diff for: CHANGE_LOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Sephpa - Change Log
22
===============
33

4+
## 1.3.3 - Mar 4, 21
5+
- Fixed typo in `ultmtCdtr` (was `ultmtCdrt` before). The old version still works for backward compatibility.
6+
47
## 1.3.2 - Feb 23, 21
58
- Added support for keys `pstladr` and `cdtrpstladr`. Both are aliases for `dbtrpstladr`.
69

Diff for: src/SepaUtilities.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class SepaUtilities
4747
const SEPA_PAIN_001_003_03 = 100303;
4848
const SEPA_PAIN_001_001_03 = 100103;
4949
const SEPA_PAIN_001_001_03_GBIC = 1001031;
50-
const SEPA_PAIN_001_001_03_CH_02 = 1001032;
50+
const SEPA_PAIN_001_001_03_CH_02 = 1001032;
5151
// direct debit versions
5252
const SEPA_PAIN_008_002_02 = 800202;
5353
const SEPA_PAIN_008_003_02 = 800302;
@@ -640,7 +640,7 @@ private static function getValFromMultiDimInput(array &$input, $keys)
640640
*
641641
* @param string $field Valid fields are: 'orgnlcdtrschmeid_id','ci','msgid','pmtid','pmtinfid',
642642
* 'orgnlmndtid','mndtid','initgpty','cdtr','dbtr','orgnlcdtrschmeid_nm',
643-
* 'ultmtcdrt','ultmtdbtr','rmtinf','orgnldbtracct_iban','iban','bic',
643+
* 'ultmtcdtr','ultmtdbtr','rmtinf','orgnldbtracct_iban','iban','bic',
644644
* 'ccy','amendment', 'btchbookg','instdamt','seqtp','lclinstrm',
645645
* 'elctrncsgntr','reqdexctndt','purp','ctgypurp','orgnldbtragt', 'adrline'
646646
* 'ctry', 'dbtrpstladr', 'cdtrpstladr', 'pstladr'
@@ -698,6 +698,7 @@ public static function check(string $field, $input, array $options = null)
698698
return in_array(false, $input, true) ? false : array_values($input);
699699
} // if not => fall through
700700
case 'orgnlcdtrschmeid_nm':
701+
case 'ultmtcdrt': // deprecated, just here for backwards compatibility
701702
case 'ultmtcdtr':
702703
case 'ultmtdbtr':
703704
return ( self::checkLength($input, self::TEXT_LENGTH_SHORT)
@@ -865,7 +866,7 @@ public static function sanitizeText(int $length, string $input, bool $allowEmpty
865866
/**
866867
* Tries to sanitize the the input so it fits in the field.
867868
*
868-
* @param string $field Valid fields are: 'ultmtcdrt', 'ultmtdbtr',
869+
* @param string $field Valid fields are: 'ultmtcdtr', 'ultmtdbtr',
869870
* 'orgnlcdtrschmeid_nm', 'initgpty', 'cdtr', 'dbtr', 'rmtinf', 'adrline'
870871
* @param mixed $input
871872
* @param int $flags Flags used in replaceSpecialChars()
@@ -887,7 +888,8 @@ public static function sanitize(string $field, $input, int $flags = 0)
887888

888889
return in_array(false, $input, true) ? false : $input;
889890
}
890-
case 'ultmtcdrt':
891+
case 'ultmtcdrt': // deprecated, just here for backwards compatibility
892+
case 'ultmtcdtr':
891893
case 'ultmtdbtr':
892894
case 'ultmtdebtr': // deprecated, just here for backwards compatibility
893895
return self::sanitizeText(self::TEXT_LENGTH_SHORT, $input, true, $flags);
@@ -1282,7 +1284,7 @@ public static function version2string(int $version)
12821284
switch($version)
12831285
{ // fall-through's are on purpose
12841286
case self::SEPA_PAIN_001_001_03_GBIC:
1285-
case self::SEPA_PAIN_001_001_03_CH_02:
1287+
case self::SEPA_PAIN_001_001_03_CH_02:
12861288
case self::SEPA_PAIN_001_001_03: return 'pain.001.001.03';
12871289
case self::SEPA_PAIN_001_002_03: return 'pain.001.002.03';
12881290
case self::SEPA_PAIN_001_003_03: return 'pain.001.003.03';

0 commit comments

Comments
 (0)