Skip to content

Commit

Permalink
# 2.0.2 - 2018-04-18
Browse files Browse the repository at this point in the history
### CHANGES:
##### validation:
- small refactor (remove unused code) in getCoutryCodeByVatNumberTest.
  • Loading branch information
lopadova committed Apr 18, 2018
1 parent 6b76155 commit e54a892
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All Notable changes to `support` will be documented in this file

## 2.0.2 - 2018-04-18

### CHANGES:
##### validation:
- small refactor (remove unused code) in getCoutryCodeByVatNumberTest.

## 2.0.1 - 2018-04-18

### ADD:
Expand Down
4 changes: 1 addition & 3 deletions src/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -735,9 +735,7 @@ function getCoutryCodeByVatNumber(string $pi, string $fallback ='IT'): string

//try to find country code
$countryCode = strtoupper(substr($pi, 0, 2));
if (preg_match('/^[A-Za-z]{2}$/', $countryCode) === 1) {
$pi = substr($pi, 2);
} else {
if (!(preg_match('/^[A-Za-z]{2}$/', $countryCode) === 1)) {
$countryCode = $fallback;
}
return $countryCode;
Expand Down

0 comments on commit e54a892

Please sign in to comment.