Skip to content

Commit ad5f91f

Browse files
committed
bug #29531 [Validator] Added IBAN format for Vatican City State (raulfraile)
This PR was squashed before being merged into the 3.4 branch (closes #29531). Discussion ---------- [Validator] Added IBAN format for Vatican City State IBAN for Vatican City State was added to [IBAN registry](https://www.swift.com/sites/default/files/resources/iban_registry.pdf) recently. This PR adds support for this new format in the `Iban` validator. | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT Commits ------- 5f0261429a [Validator] Added IBAN format for Vatican City State
2 parents c0af1ae + 813c4a3 commit ad5f91f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Constraints/IbanValidator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ class IbanValidator extends ConstraintValidator
129129
'TN' => 'TN59\d{2}\d{3}\d{13}\d{2}', // Tunisia
130130
'TR' => 'TR\d{2}\d{5}[\dA-Z]{1}[\dA-Z]{16}', // Turkey
131131
'UA' => 'UA\d{2}\d{6}[\dA-Z]{19}', // Ukraine
132+
'VA' => 'VA\d{2}\d{3}\d{15}', // Vatican City State
132133
'VG' => 'VG\d{2}[A-Z]{4}\d{16}', // Virgin Islands, British
133134
'WF' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Wallis and Futuna Islands
134135
'XK' => 'XK\d{2}\d{4}\d{10}\d{2}', // Republic of Kosovo

Tests/Constraints/IbanValidatorTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ public function getValidIbans()
156156
array('TR330006100519786457841326'), //Turkey
157157
array('UA213223130000026007233566001'), //Ukraine
158158
array('AE260211000000230064016'), //United Arab Emirates
159+
array('VA59001123000012345678'), //Vatican City State
159160
);
160161
}
161162

@@ -274,6 +275,7 @@ public function getIbansWithInvalidFormat()
274275
array('TR3300061005197864578413261'), //Turkey
275276
array('UA21AAAA1300000260072335660012'), //Ukraine
276277
array('AE2602110000002300640161'), //United Arab Emirates
278+
array('VA590011230000123456781'), //Vatican City State
277279
);
278280
}
279281

@@ -385,6 +387,7 @@ public function getIbansWithValidFormatButIncorrectChecksum()
385387
array('TR330006100519786457841327'), //Turkey
386388
array('UA213223130000026007233566002'), //Ukraine
387389
array('AE260211000000230064017'), //United Arab Emirates
390+
array('VA59001123000012345671'), //Vatican City State
388391
);
389392
}
390393

0 commit comments

Comments
 (0)