Update BuyableProduct.php

This commit is contained in:
Patrick
2022-02-05 18:04:14 +01:00
committed by GitHub
parent f7779e0797
commit 3b3f17b301

View File

@@ -3,6 +3,7 @@
namespace Gloudemans\Tests\Shoppingcart\Fixtures;
use Gloudemans\Shoppingcart\Contracts\Buyable;
use Gloudemans\Shoppingcart\CartItemOptions;
use Illuminate\Database\Eloquent\Model;
use Money\Money;
use Money\Currency;
@@ -37,7 +38,7 @@ class BuyableProduct extends Model implements Buyable
*
* @return int|string
*/
public function getBuyableIdentifier()
public function getBuyableIdentifier(CartItemOptions $options)
{
return $this->id;
}
@@ -47,7 +48,7 @@ class BuyableProduct extends Model implements Buyable
*
* @return string
*/
public function getBuyableDescription() : ?string
public function getBuyableDescription(CartItemOptions $options) : ?string
{
return $this->name;
}
@@ -55,7 +56,7 @@ class BuyableProduct extends Model implements Buyable
/**
* Get the price of the Buyable item.
*/
public function getBuyablePrice(): Money
public function getBuyablePrice(CartItemOptions $options): Money
{
return new Money($this->price, new Currency($this->currency));
}
@@ -63,7 +64,7 @@ class BuyableProduct extends Model implements Buyable
/**
* Get the price of the Buyable item.
*/
public function getBuyableWeight(): int
public function getBuyableWeight(CartItemOptions $options): int
{
return $this->weight;
}