From ebda7b7033142798e069f8eb9a15ca4257548d97 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 26 Apr 2023 10:23:23 +1000 Subject: [PATCH] Cast int to string --- app/DataMapper/Tax/BaseRule.php | 2 +- app/DataMapper/Tax/DE/Rule.php | 2 +- app/DataMapper/Tax/US/Rule.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/DataMapper/Tax/BaseRule.php b/app/DataMapper/Tax/BaseRule.php index bf8481b1faaf..5c6aa4cc74e9 100644 --- a/app/DataMapper/Tax/BaseRule.php +++ b/app/DataMapper/Tax/BaseRule.php @@ -235,7 +235,7 @@ class BaseRule implements RuleInterface return $this; } elseif($this->isTaxableRegion()) { //other regions outside of US - match($item->tax_id) { + match(intval($item->tax_id)) { Product::PRODUCT_TYPE_EXEMPT => $this->taxExempt(), Product::PRODUCT_TYPE_REDUCED_TAX => $this->taxReduced(), Product::PRODUCT_TYPE_OVERRIDE_TAX => $this->override(), diff --git a/app/DataMapper/Tax/DE/Rule.php b/app/DataMapper/Tax/DE/Rule.php index 8a84e9933e45..8315a51792eb 100644 --- a/app/DataMapper/Tax/DE/Rule.php +++ b/app/DataMapper/Tax/DE/Rule.php @@ -66,7 +66,7 @@ class Rule extends BaseRule implements RuleInterface return $this->taxExempt(); } - match($product_tax_type){ + match(intval($product_tax_type)){ Product::PRODUCT_TYPE_EXEMPT => $this->taxExempt(), Product::PRODUCT_TYPE_DIGITAL => $this->taxDigital(), Product::PRODUCT_TYPE_SERVICE => $this->taxService(), diff --git a/app/DataMapper/Tax/US/Rule.php b/app/DataMapper/Tax/US/Rule.php index 11b08ce41f81..87482875643d 100644 --- a/app/DataMapper/Tax/US/Rule.php +++ b/app/DataMapper/Tax/US/Rule.php @@ -57,7 +57,7 @@ class Rule extends BaseRule implements RuleInterface public function taxByType($product_tax_type): self { - match($product_tax_type) { + match(intval($product_tax_type)) { Product::PRODUCT_TYPE_EXEMPT => $this->taxExempt(), Product::PRODUCT_TYPE_DIGITAL => $this->taxDigital(), Product::PRODUCT_TYPE_SERVICE => $this->taxService(), @@ -117,7 +117,7 @@ class Rule extends BaseRule implements RuleInterface */ public function taxShipping(): self { - if($this->tax_data->txbFreight == 'Y') { + if($this->tax_data?->txbFreight == 'Y') { $this->default(); }