Skip to content

Commit

Permalink
Code refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Jul 12, 2024
1 parent 6ddd2e1 commit 8116f55
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
32 changes: 31 additions & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,36 @@ parameters:
count: 1
path: src/CartConditions/Coupon.php

-
message: "#^Access to an undefined property Illuminate\\\\Support\\\\Optional\\:\\:\\$discount\\.$#"
count: 2
path: src/CartConditions/Coupon.php

-
message: "#^Access to an undefined property Illuminate\\\\Support\\\\Optional\\:\\:\\$group\\.$#"
count: 1
path: src/CartConditions/Coupon.php

-
message: "#^Call to an undefined method Illuminate\\\\Support\\\\Optional\\:\\:appliesOnDelivery\\(\\)\\.$#"
count: 1
path: src/CartConditions/Coupon.php

-
message: "#^Call to an undefined method Illuminate\\\\Support\\\\Optional\\:\\:appliesOnMenuItems\\(\\)\\.$#"
count: 1
path: src/CartConditions/Coupon.php

-
message: "#^Call to an undefined method Illuminate\\\\Support\\\\Optional\\:\\:discountWithOperand\\(\\)\\.$#"
count: 1
path: src/CartConditions/Coupon.php

-
message: "#^Call to an undefined method Illuminate\\\\Support\\\\Optional\\:\\:isFixed\\(\\)\\.$#"
count: 1
path: src/CartConditions/Coupon.php

-
message: "#^Call to an undefined static method Igniter\\\\Cart\\\\Facades\\\\Cart\\:\\:content\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -81,7 +111,7 @@ parameters:
path: src/CartConditions/Coupon.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\:\\:isEnabled\\(\\)\\.$#"
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\<Igniter\\\\Coupons\\\\Models\\\\Coupon\\>\\:\\:isEnabled\\(\\)\\.$#"
count: 1
path: src/Extension.php

Expand Down
4 changes: 2 additions & 2 deletions src/CartConditions/Coupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function getValue()

public function getModel()
{
if (!strlen($couponCode = $this->getMetaData('code'))) {
if (!strlen($couponCode = $this->getMetaData('code', ''))) {
return null;
}

Expand All @@ -68,7 +68,7 @@ public function getApplicableItems($couponModel)

public function onLoad()
{
if (!strlen($this->getMetaData('code')) || self::$hasErrors) {
if (!strlen($this->getMetaData('code', '')) || self::$hasErrors) {
return;
}

Expand Down

0 comments on commit 8116f55

Please sign in to comment.