From 9501f4c0622374271c7ad5de7afe2a1588d211b6 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 17 Jan 2022 23:46:40 +0100 Subject: [PATCH] Update CartItem.php --- src/CartItem.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CartItem.php b/src/CartItem.php index 1d1658e..5ae82e3 100644 --- a/src/CartItem.php +++ b/src/CartItem.php @@ -51,7 +51,7 @@ class CartItem implements Arrayable, Jsonable * * @var string */ - public $name; + public string $name; /** * The price without TAX of the cart item. @@ -107,7 +107,7 @@ class CartItem implements Arrayable, Jsonable * @param float $weight * @param array $options */ - public function __construct($id, $name, $price, $weight = 0, array $options = []) + public function __construct($id, string $name, $price, $weight = 0, array $options = []) { if (empty($id)) { throw new \InvalidArgumentException('Please supply a valid identifier.'); @@ -239,7 +239,7 @@ class CartItem implements Arrayable, Jsonable * * @return string */ - public function taxTotal($decimals = null, $decimalPoint = null, $thousandSeperator = null) + public function taxTotal(?int $decimals = null, ?string $decimalPoint = null, ?string $thousandSeperator = null) { return $this->numberFormat($this->taxTotal, $decimals, $decimalPoint, $thousandSeperator); } @@ -253,7 +253,7 @@ class CartItem implements Arrayable, Jsonable * * @return string */ - public function discount($decimals = null, $decimalPoint = null, $thousandSeperator = null) + public function discount(?int $decimals = null, ?string $decimalPoint = null, ?string $thousandSeperator = null) { return $this->numberFormat($this->discount, $decimals, $decimalPoint, $thousandSeperator); } @@ -267,7 +267,7 @@ class CartItem implements Arrayable, Jsonable * * @return string */ - public function discountTotal($decimals = null, $decimalPoint = null, $thousandSeperator = null) + public function discountTotal(?int $decimals = null, ?string $decimalPoint = null, ?string $thousandSeperator = null) { return $this->numberFormat($this->discountTotal, $decimals, $decimalPoint, $thousandSeperator); } @@ -281,7 +281,7 @@ class CartItem implements Arrayable, Jsonable * * @return string */ - public function priceTotal($decimals = null, $decimalPoint = null, $thousandSeperator = null) + public function priceTotal(?int $decimals = null, ?string $decimalPoint = null, ?string $thousandSeperator = null) { return $this->numberFormat($this->priceTotal, $decimals, $decimalPoint, $thousandSeperator); }