Skip to content

Commit 1ee7d5c

Browse files
[16.x] refactor: allow null coupon and promotion code IDs (#1808)
* refactor(AllowsCoupons): allow null coupon and promotion code IDs Update method signatures to accept null values for couponId and promotionCodeId parameters to handle cases where these values might be unset * fix ci * Revert "fix ci" This reverts commit f6ca1b1. * fix ci
1 parent 5d2925b commit 1ee7d5c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/Concerns/AllowsCoupons.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,11 @@ trait AllowsCoupons
1111

1212
/**
1313
* The coupon ID being applied.
14-
*
15-
* @var string|null
1614
*/
1715
public ?string $couponId = null;
1816

1917
/**
2018
* The promotion code ID being applied.
21-
*
22-
* @var string|null
2319
*/
2420
public ?string $promotionCodeId = null;
2521

@@ -33,10 +29,9 @@ trait AllowsCoupons
3329
/**
3430
* The coupon ID to be applied.
3531
*
36-
* @param string $couponId
3732
* @return $this
3833
*/
39-
public function withCoupon(string $couponId)
34+
public function withCoupon(?string $couponId)
4035
{
4136
$this->couponId = $couponId;
4237

@@ -46,10 +41,9 @@ public function withCoupon(string $couponId)
4641
/**
4742
* The promotion code ID to apply.
4843
*
49-
* @param string $promotionCodeId
5044
* @return $this
5145
*/
52-
public function withPromotionCode(string $promotionCodeId)
46+
public function withPromotionCode(?string $promotionCodeId)
5347
{
5448
$this->promotionCodeId = $promotionCodeId;
5549

0 commit comments

Comments
 (0)