Skip to content

Commit

Permalink
Merge pull request #15 from crazyfactory/allow_leading_zero_lu_countr…
Browse files Browse the repository at this point in the history
…y_postal_code

feat: allow leading 0 for LU postal code
  • Loading branch information
z3niths authored Feb 25, 2020
2 parents 9e4cca7 + ed53ff8 commit 4040bcb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ZipCode/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Validator
// 'IE' => '[-1-9]{1}', See above
'IT' => '\\d{5}',
'LT' => '\\d{5}',
'LU' => '[1-9]\\d{3}',
'LU' => '[0-9]\\d{3}',
'LV' => '[1-9]{1}\\d{3}',
'MC' => '98[0-9]{3}',
'MT' => '[A-Z]{3}\\s[1-9]{1}[0-9]{3}',
Expand Down
1 change: 1 addition & 0 deletions tests/unit/ZipCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function testIsValid()
$this->assertTrue(Validator::isValid('01234', 'FR'), 'FR');
$this->assertTrue(Validator::isValid('M6 6SD', 'GB'), 'GB: M6 6SD');
$this->assertTrue(Validator::isValid('11111', 'HR'), 'HR: 11111');
$this->assertTrue(Validator::isValid('0363', 'LU'), 'LU');

$noPostCodeCountries = ['AE', 'AU', 'BA', 'CO', 'QA'];
foreach ($noPostCodeCountries as $country) {
Expand Down

0 comments on commit 4040bcb

Please sign in to comment.