Skip to content

Commit e54a892

Browse files
committed
# 2.0.2 - 2018-04-18
### CHANGES: ##### validation: - small refactor (remove unused code) in getCoutryCodeByVatNumberTest.
1 parent 6b76155 commit e54a892

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

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

5+
## 2.0.2 - 2018-04-18
6+
7+
### CHANGES:
8+
##### validation:
9+
- small refactor (remove unused code) in getCoutryCodeByVatNumberTest.
10+
511
## 2.0.1 - 2018-04-18
612

713
### ADD:

src/validation.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -735,9 +735,7 @@ function getCoutryCodeByVatNumber(string $pi, string $fallback ='IT'): string
735735

736736
//try to find country code
737737
$countryCode = strtoupper(substr($pi, 0, 2));
738-
if (preg_match('/^[A-Za-z]{2}$/', $countryCode) === 1) {
739-
$pi = substr($pi, 2);
740-
} else {
738+
if (!(preg_match('/^[A-Za-z]{2}$/', $countryCode) === 1)) {
741739
$countryCode = $fallback;
742740
}
743741
return $countryCode;

0 commit comments

Comments
 (0)