Merge pull request #30 from Sartoric/master

Update CartItem.php
This commit is contained in:
Patrick
2019-10-21 19:53:47 +02:00
committed by GitHub

View File

@@ -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 = [])
@@ -98,7 +99,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.');
}