From 00fe4b93bd40cba1b6e707bb1d57cc1e94ed5c79 Mon Sep 17 00:00:00 2001 From: MiBo Date: Sun, 5 Nov 2023 14:43:41 +0100 Subject: [PATCH] fix(VAT): Compare using is --- CHANGELOG.md | 5 +++++ src/VAT.php | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4d55d3..7faeece 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.0.1] - 2023-11-05 + +### Fixed +- VAT - Comparing VATs + ## [2.0.0] - 2023-10-03 ### Added diff --git a/src/VAT.php b/src/VAT.php index 697bdaa..ff43d50 100644 --- a/src/VAT.php +++ b/src/VAT.php @@ -106,10 +106,10 @@ public function getDate(): DateTimeInterface public function is(self $vat, bool $strict = false): bool { return $strict - ? $this->classification === $vat->getClassification() - && $this->rate->name === $vat->getRate()->name + ? $this->classification->is($vat->getClassification()) + && $this->rate->equals($vat->getRate()) && $this->countryCode === $vat->getCountryCode() - : $this->classification === $vat->getClassification(); + : $this->classification->is($vat->getClassification()); } /**