Skip to content
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

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ TIN::fromSlug('be7110.2512345')->check(); // Not strict
TIN::fromSlug('be7110.2512345')->check(strict: false); // Not strict
TIN::fromSlug('be7110.2512345')->check(true); // Strict
TIN::fromSlug('be7110.2512345')->check(strict: true); // Strict

```

## Installation

Expand Down
6 changes: 1 addition & 5 deletions src/CountryHandler/CountryHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ final public function __construct(string $tin = '')

public function getTIN(): string
{
if (null !== $string = preg_replace('#[^[:alnum:]\-+]#u', '', $this->tin)) {
return strtoupper($string);
}

return '';
return strtoupper($this->tin);
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree you

}

final public static function supports(string $country): bool
Expand Down
2 changes: 1 addition & 1 deletion src/TIN.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function isValid(bool $strict = false): bool

return true;
}

/**
* @throws TINException
*/
Expand Down
Loading