Skip to content

Commit

Permalink
Removed obsolete VAT ID format support (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
janlanger authored and kukulich committed Jan 10, 2017
1 parent d6bff71 commit bd3acb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions Jyxo/Input/Validator/IsTaxId.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ public function isValid($value): bool
// New Tax ID format since 1st May 2004
if (preg_match('~^CZ(\\d{8,10})$~', $taxId, $matches)) {
$sub = $matches[1];
// But to be sure we try the old one as well
} elseif (preg_match('~^\\d{3}-(\\d{8,10})$~', $taxId, $matches)) {
$sub = $matches[1];
}
if (!empty($sub)) {
// Strict checking off - allows the so called "own numbers"
Expand Down
4 changes: 2 additions & 2 deletions tests/Jyxo/Input/ValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@ public function testIsTaxId()
{
$good = [
'CZ 26704706',
'267-26704706',
'CZ 8405011330'
];
$wrong = [
'SK12345678',
'CZ 8405011328'
'CZ 8405011328',
'267-26704706'
];

$this->executeTests(new Validator\IsTaxId(), $good, $wrong);
Expand Down

0 comments on commit bd3acb8

Please sign in to comment.