Skip to content

Commit

Permalink
Buyable return types
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBelgium committed Feb 21, 2023
1 parent 05239c8 commit 39c5e18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions src/CanBeBought.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ public function getBuyableIdentifier($options = null)

/**
* Get the description or title of the Buyable item.
*
* @return string
*/
public function getBuyableDescription($options = null)
public function getBuyableDescription($options = null): ?string
{
if(property_exists($this, 'name')) return $this->name;
if(property_exists($this, 'title')) return $this->title;
Expand All @@ -31,10 +29,8 @@ public function getBuyableDescription($options = null)

/**
* Get the price of the Buyable item.
*
* @return float
*/
public function getBuyablePrice($options = null)
public function getBuyablePrice($options = null): ?float
{
if(property_exists($this, 'price')) return $this->price;

Expand Down
8 changes: 2 additions & 6 deletions src/Contracts/Buyable.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@ public function getBuyableIdentifier($options = null);

/**
* Get the description or title of the Buyable item.
*
* @return string
*/
public function getBuyableDescription($options = null);
public function getBuyableDescription($options = null): ?string;

/**
* Get the price of the Buyable item.
*
* @return float
*/
public function getBuyablePrice($options = null);
public function getBuyablePrice($options = null): ?float;
}

0 comments on commit 39c5e18

Please sign in to comment.