Skip to content

Commit 27d6acd

Browse files
authored
disallow DK postcodes starting 0 (#14)
1 parent 92b1871 commit 27d6acd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Validator/LocalizedPostalCodeValidatorClosureProvider.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ public function fetchValidatorForCountry($country, $message = null)
7171

7272
return $this->createValidatorClosureForConstraint($constraint);
7373

74-
case 'DK':
7574
case 'BE':
76-
case 'NO';
75+
case 'NO':
7776
return $this->createValidatorClosureForConstraint($this->getFixedLengthDigitConstraint(4, $message));
7877

7978
case 'ES':
@@ -83,6 +82,9 @@ public function fetchValidatorForCountry($country, $message = null)
8382
case 'DE':
8483
return $this->createValidatorClosureForConstraint($this->getFixedLengthDigitConstraint(5, $message));
8584

85+
case 'DK':
86+
return $this->createValidatorClosureForConstraint($this->getMultipleRegexConstraint(['/^[1-9]\d{3}$/'], $message));
87+
8688
case 'NL':
8789
return $this->createValidatorClosureForConstraint($this->getMultipleRegexConstraint(['/^\d{4}\s[A-Z]{2}$/'], $message));
8890

0 commit comments

Comments
 (0)