Add this new function to TIN.php
ortegafernando opened this issue · 4 comments
ortegafernando commented
Hello, as we can not catch the invalidCountry exception exclusively, I think this function will be good to detect is the TIN's country BEFORE using check function.
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;
}
I can make a PULL REQUEST if you want.
ortegafernando commented
Hi, what about last PR ?
drupol commented
Hi,
Sorry, I'm a bit overwhelmed with work lately...
How about adding just Tin::isSupported():bool
?
Feel free to provide the PR.
drupol commented
yes, thank you !