Skip to content

Commit

Permalink
Improve error handling
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Jan 7, 2024
1 parent b82479f commit bbbd189
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Actions/RedeemsCoupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bbbd189

Please sign in to comment.