From a7049342dce3adc14d3799fa858b5fdb22c60669 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 17 Jul 2024 11:24:29 +0200 Subject: [PATCH] chore: fix README --- README.md | 3 +-- src/CountryHandler/Slovakia.php | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6d4ca94..85d4ef4 100644 --- a/README.md +++ b/README.md @@ -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 @@ -145,4 +145,3 @@ Support our contributors by sponsoring them on [Github][github sponsors link]. https://img.shields.io/github/actions/workflow/status/loophp/tin/tests.yml?branch=master&style=flat-square [github sponsors link]: https://github.com/loophp/tin/graphs/contributors [github actions link]: https://github.com/loophp/tin/actions -``` diff --git a/src/CountryHandler/Slovakia.php b/src/CountryHandler/Slovakia.php index 0bf80a6..f3d75a5 100644 --- a/src/CountryHandler/Slovakia.php +++ b/src/CountryHandler/Slovakia.php @@ -44,11 +44,12 @@ public function hasValidRule(string $tin): bool protected function hasValidLength(string $tin): bool { $c1c2 = substr($tin, 0, 2); + $hasValidLength = parent::hasValidLength($tin); if (54 > $c1c2) { - return $this->matchLength($tin, self::LENGTH) || $this->matchLength($tin, self::LENGTH - 1); + return $hasValidLength || $this->matchLength($tin, self::LENGTH - 1); } - return parent::hasValidLength($tin); + return $hasValidLength; } }