From bbbd1895c70c0858aeb96f0d0f4cee8ffe577c4e Mon Sep 17 00:00:00 2001 From: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> Date: Sun, 7 Jan 2024 15:56:38 +0000 Subject: [PATCH] Improve error handling Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> --- src/Actions/RedeemsCoupon.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Actions/RedeemsCoupon.php b/src/Actions/RedeemsCoupon.php index 395383f..d4ed332 100644 --- a/src/Actions/RedeemsCoupon.php +++ b/src/Actions/RedeemsCoupon.php @@ -17,15 +17,8 @@ class RedeemsCoupon extends ModelAction * Redeem coupon by order * @throws \Exception */ - public function redeemCoupon($couponCondition) + public function redeemCoupon(CartCondition $couponCondition) { - if (!$couponCondition instanceof CartCondition) { - throw new \InvalidArgumentException(sprintf( - 'Invalid argument, expected %s, got %s', - CartCondition::class, get_class($couponCondition) - )); - } - if (!$couponLog = $this->logCouponHistory($couponCondition)) { return false; }