mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-23 23:51:25 +00:00
@@ -85,6 +85,7 @@ class CartItem implements Arrayable, Jsonable
|
|||||||
* @param int|string $id
|
* @param int|string $id
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @param float $price
|
* @param float $price
|
||||||
|
* @param float $weight
|
||||||
* @param array $options
|
* @param array $options
|
||||||
*/
|
*/
|
||||||
public function __construct($id, $name, $price, $weight = 0, 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)) {
|
if (strlen($price) < 0 || !is_numeric($price)) {
|
||||||
throw new \InvalidArgumentException('Please supply a valid 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.');
|
throw new \InvalidArgumentException('Please supply a valid weight.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user