diff --git a/src/Services/TaxCollectionService.php b/src/Services/TaxCollectionService.php index 3da3fbd4..c673de2e 100644 --- a/src/Services/TaxCollectionService.php +++ b/src/Services/TaxCollectionService.php @@ -10,7 +10,7 @@ use Bavix\Wallet\Interfaces\Wallet; use Bavix\Wallet\Internal\Service\MathServiceInterface; -class TaxCollectionService implements TaxCollectionServiceInterface +final readonly class TaxCollectionService implements TaxCollectionServiceInterface { public function __construct( private MathServiceInterface $mathService, @@ -35,7 +35,7 @@ public function calculate( $feeMaximum = $wallet->getMaximumTax($type); } - $fee = '0'; + $fee = 0; if ($feePercent !== null) { $fee = $this->mathService->floor( $this->mathService->div( @@ -55,6 +55,6 @@ public function calculate( $fee = $feeMaximum; } - return $fee; + return (string) $fee; } }