From 9605395097d78c7a8b81c457be82b685704206f2 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 5 Feb 2022 20:45:58 +0100 Subject: [PATCH] Update Cart.php --- src/Cart.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Cart.php b/src/Cart.php index 709ac6e..04d775a 100644 --- a/src/Cart.php +++ b/src/Cart.php @@ -362,7 +362,7 @@ class Cart /** * Get the total tax of the items in the cart. */ - public function tax(): float + public function tax(): Money { return $this->getContent()->reduce(function (Money $tax, CartItem $cartItem) { return $tax->add($cartItem->taxTotal); @@ -384,7 +384,7 @@ class Cart * * @return float */ - public function discount(): float + public function discount(): Money { return $this->getContent()->reduce(function (Money $discount, CartItem $cartItem) { return $discount->add($cartItem->discountTotal); @@ -394,7 +394,7 @@ class Cart /** * Get the price of the items in the cart (not rounded). */ - public function initial(): float + public function initial(): Money { return $this->getContent()->reduce(function (Money $initial, CartItem $cartItem) { return $initial->add($cartItem->price->multiply($cartItem->qty));