Skip to content

Commit

Permalink
Added hasAlgorithm public function
Browse files Browse the repository at this point in the history
  • Loading branch information
ortegafernando authored Jun 8, 2024
1 parent 5613450 commit a3c0e25
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/TIN.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,17 @@ public function isValid(bool $strict = false): bool
return true;
}

public function hasAlgorithm(): bool
{
$parsedTin = $this->parse($this->slug, false);
foreach ($this->algorithms as $algorithm) {
if (true === $algorithm::supports($parsedTin['country'])) {
return true;
}
}
return false;
}

/**
* @throws TINException
*/
Expand Down

0 comments on commit a3c0e25

Please sign in to comment.