From 39c5e189ff40976ca3b860a40f983b5f5a2cd35a Mon Sep 17 00:00:00 2001 From: Michael V Date: Tue, 21 Feb 2023 01:51:35 +0100 Subject: [PATCH] Buyable return types --- src/CanBeBought.php | 8 ++------ src/Contracts/Buyable.php | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/CanBeBought.php b/src/CanBeBought.php index 96e0e534..17cf09c3 100644 --- a/src/CanBeBought.php +++ b/src/CanBeBought.php @@ -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; @@ -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; diff --git a/src/Contracts/Buyable.php b/src/Contracts/Buyable.php index f5bfeb7b..e9a9dd75 100644 --- a/src/Contracts/Buyable.php +++ b/src/Contracts/Buyable.php @@ -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; } \ No newline at end of file