Skip to content

Commit

Permalink
Update TIN class and pass the TIN number to the exception when throwing.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 15, 2021
1 parent 2ddfca9 commit b6cf82e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/TIN.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?php

/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace loophp\Tin;
Expand Down Expand Up @@ -145,7 +150,7 @@ private function parse(string $slug): array

// [alpha][alpha][not-alpha](anything)
if (0 === preg_match(sprintf('/^%s$/', $pattern), $slug, $matches)) {
throw TINException::invalidPattern();
throw TINException::invalidPattern($slug);
}

return array_intersect_key($matches, array_flip(['country', 'tin']));
Expand Down

0 comments on commit b6cf82e

Please sign in to comment.