Update CanBeBought.php

This commit is contained in:
Patrick
2022-02-03 00:24:57 +01:00
committed by GitHub
parent a816a21a27
commit bc91ea1976

View File

@@ -2,6 +2,8 @@
namespace Gloudemans\Shoppingcart;
use Money\Money;
trait CanBeBought
{
/**
@@ -16,8 +18,6 @@ trait CanBeBought
/**
* Get the name, title or description of the Buyable item.
*
* @return string
*/
public function getBuyableDescription(): ?string
{
@@ -34,10 +34,8 @@ trait CanBeBought
/**
* Get the price of the Buyable item.
*
* @return float
*/
public function getBuyablePrice()
public function getBuyablePrice(): Money
{
if (($price = $this->getAttribute('price'))) {
return $price;
@@ -46,10 +44,8 @@ trait CanBeBought
/**
* Get the weight of the Buyable item.
*
* @return float
*/
public function getBuyableWeight()
public function getBuyableWeight(): float
{
if (($weight = $this->getAttribute('weight'))) {
return $weight;