From f31c153e3e6a4898b9498d412be39086086d2e3b Mon Sep 17 00:00:00 2001 From: Cristian Date: Mon, 21 Oct 2019 19:00:34 +0200 Subject: [PATCH 1/2] Update CartItem.php weight variable in if block --- src/CartItem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CartItem.php b/src/CartItem.php index 5a49ef2..667bedc 100644 --- a/src/CartItem.php +++ b/src/CartItem.php @@ -98,7 +98,7 @@ class CartItem implements Arrayable, Jsonable if (strlen($price) < 0 || !is_numeric($price)) { throw new \InvalidArgumentException('Please supply a valid price.'); } - if (strlen($price) < 0 || !is_numeric($weight)) { + if (strlen($weight) < 0 || !is_numeric($weight)) { throw new \InvalidArgumentException('Please supply a valid weight.'); } From d0cf5d7ab0a26ed7fc0eb9239d4a96ece2867d8a Mon Sep 17 00:00:00 2001 From: Patrick Henninger Date: Mon, 21 Oct 2019 19:52:03 +0200 Subject: [PATCH 2/2] Corrected PHPDoc --- src/CartItem.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CartItem.php b/src/CartItem.php index 667bedc..5efb546 100644 --- a/src/CartItem.php +++ b/src/CartItem.php @@ -85,6 +85,7 @@ class CartItem implements Arrayable, Jsonable * @param int|string $id * @param string $name * @param float $price + * @param float $weight * @param array $options */ public function __construct($id, $name, $price, $weight = 0, array $options = [])