-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strict mode: Fix readme.md and fix getTIN function #43
Changes from 3 commits
e2ca568
5613450
a3c0e25
aaeaa0c
d8ec747
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,6 +120,17 @@ public function isValid(bool $strict = false): bool | |
return true; | ||
} | ||
|
||
public function hasAlgorithm(): bool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about keeping the "algorithm" side of things internally and expose a simpler interface? In this case, I would just name this method There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is better, I agree you, better isSupported() |
||
{ | ||
$parsedTin = $this->parse($this->slug, false); | ||
foreach ($this->algorithms as $algorithm) { | ||
if (true === $algorithm::supports($parsedTin['country'])) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
/** | ||
* @throws TINException | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to keep that in the existing normalize function. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree you